id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
11337147_573
{ "fields": [ { "declarator": "processDatastore", "modifier": "private", "original_string": "private ProcessDatastore processDatastore;", "type": "ProcessDatastore", "var_name": "processDatastore" }, { "declarator": "engineSession", "modifier": "@Mock\n private...
{ "body": "@Test(expected = APIForbiddenException.class)\n public void it_throws_an_exception_adding_a_bar_file_with_unauthorized_path() throws IOException {\n // Given\n doThrow(new UnauthorizedFolderException(\"\")).when(tenantFolder).getTempFile(any(String.class), any(Long.class));\n\n // W...
{ "fields": [ { "declarator": "logger = Logger.getLogger(ProcessDatastore.class.getName())", "modifier": "private static final", "original_string": "private static final Logger logger = Logger.getLogger(ProcessDatastore.class.getName());", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public ProcessItem add(final ProcessItem process) {\n final ProcessEngineClient engineClient = getProcessEngineClient();\n\n File processFile;\n try {\n processFile = getTenantFolder().getTempFile(process.getAttributes().get(FILE_UPLOAD), getEngineSession().ge...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_22
{ "fields": [ { "declarator": "util = new FormFieldValuesUtil()", "modifier": "", "original_string": "FormFieldValuesUtil util = new FormFieldValuesUtil();", "type": "FormFieldValuesUtil", "var_name": "util" } ], "file": "forms/forms-server/src/test/java/org/bonitasoft/forms/...
{ "body": "@Test\n public void testWeRetrieveExpressionOfDisplayedWidgetOnly() throws Exception {\n final List<FormWidget> widgets = Arrays.asList(\n aWidgetWithLabelExpression(\"widget1\"),\n aWidgetWithLabelExpression(\"widget2\"));\n\n final Map<String, Serializable> ...
{ "fields": [ { "declarator": "INDEX_SEPARATOR = \"_\"", "modifier": "protected static final", "original_string": "protected static final String INDEX_SEPARATOR = \"_\";", "type": "String", "var_name": "INDEX_SEPARATOR" }, { "declarator": "WIDGET_LABEL = \"label\"", ...
{ "body": "protected List<Expression> getExpressionsToEvaluation(final List<FormWidget> widgets,\n final Map<String, Serializable> resolvedDisplayExp,\n final Map<String, Object> context) {\n final List<Expression> expressionsToEvaluate = new ArrayList<Expression>();\n for (final F...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_436
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "pageAPI", "modifier": "@Mock\n p...
{ "body": "@Test\n public void should_return_the_good_application_on_get() throws Exception {\n //given\n final ApplicationImpl application = new ApplicationImpl(\"app\", \"1.0\", \"app desc\");\n final ApplicationItem item = new ApplicationItem();\n given(converter.toApplicationItem(ap...
{ "fields": [ { "declarator": "applicationAPI", "modifier": "private final", "original_string": "private final ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "converter", "modifier": "private final", ...
{ "body": "@Override\n public ApplicationItem get(final APIID id) {\n try {\n final Application application = applicationAPI.getApplication(id.toLong());\n return converter.toApplicationItem(application);\n } catch (final Exception e) {\n throw new APIException(e);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_621
{ "fields": [ { "declarator": "TENANT_ID = 1L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 1L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "PAGE_ID = 123l", "modifier": "public static final", ...
{ "body": "@Test(expected = APIException.class)\n public void should_get_a_not_existing_page_rise_exception() throws Exception {\n // Given\n deleteDir(pagesDir);\n when(pageAPI.getPage(1l)).thenThrow(new PageNotFoundException(\"newPage\"));\n\n // When\n pageDatastore.get(makeAP...
{ "fields": [ { "declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"", "modifier": "public static final", "original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";", "type": "String", "var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE" }, { "de...
{ "body": "@Override\n public PageItem get(final APIID id) {\n try {\n final Page pageItem = pageAPI.getPage(id.toLong());\n return convertEngineToConsoleItem(pageItem);\n } catch (final Exception e) {\n throw new APIException(e);\n }\n }", "class_method_s...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_271
{ "fields": [ { "declarator": "PAGE_NAME = \"pageName\"", "modifier": "public static final", "original_string": "public static final String PAGE_NAME = \"pageName\";", "type": "String", "var_name": "PAGE_NAME" }, { "declarator": "PROCESS_DEFINITION_ID = 123L", "mo...
{ "body": "@Test\n public void should_testGetFullPageName_return_unique_key() throws Exception {\n assertThat(pageResourceProvider.getFullPageName()).as(\"should be page name\").isEqualTo(PAGE_NAME);\n assertThat(pageResourceProvider.getFullPageName()).as(\"should be page name\").isNotEqualTo(pageRes...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(PageResourceProviderImpl.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(PageResourceProviderImpl.class.getName());", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "@Override\n public String getFullPageName() {\n return fullPageName;\n }", "class_method_signature": "PageResourceProviderImpl.getFullPageName()", "constructor": false, "full_signature": "@Override public String getFullPageName()", "identifier": "getFullPageName", "invocations": [], ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_764
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "finderFactory", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void should_getTaskIDParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception {\n //given\n doReturn(null).when(caseContextResource).getAttribute(CaseContextResource.CASE_ID);\n\n try {\n //when\n caseContextResource.getCas...
{ "fields": [ { "declarator": "CASE_ID = \"caseId\"", "modifier": "static final", "original_string": "static final String CASE_ID = \"caseId\";", "type": "String", "var_name": "CASE_ID" }, { "declarator": "processAPI", "modifier": "private final", "original_...
{ "body": "protected long getCaseIdParameter() {\n final String caseId = getAttribute(CASE_ID);\n if (caseId == null) {\n throw new APIException(\"Attribute '\" + CASE_ID + \"' is mandatory in order to get the case context\");\n }\n return Long.parseLong(caseId);\n }", "cla...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_334
{ "fields": [ { "declarator": "aMenuLink", "modifier": "", "original_string": "ApplicationMenuImpl aMenuLink;", "type": "ApplicationMenuImpl", "var_name": "aMenuLink" }, { "declarator": "aMenuContainer", "modifier": "", "original_string": "ApplicationMenuImp...
{ "body": "@Test\n public void should_create_a_MenuContainer_containing_a_MenuLink() throws Exception {\n MenuFactory factory = new MenuFactory(applicationApi);\n\n assertThat(factory.create(asList((ApplicationMenu) aMenuContainer, aNestedMenuLink)).get(0).getHtml())\n .isEqualTo(new S...
{ "fields": [ { "declarator": "applicationApi", "modifier": "private final", "original_string": "private final ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" } ], "file": "server/src/main/java/org/bonitasoft/livingapps/menu/MenuFactory...
{ "body": "public List<Menu> create(final List<ApplicationMenu> menuList) throws ApplicationPageNotFoundException, SearchException {\n return collect(menuList, new RootMenuCollector());\n }", "class_method_signature": "MenuFactory.create(final List<ApplicationMenu> menuList)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_59
{ "fields": [ { "declarator": "apiSession = new APISessionImpl(1, new Date(), 100000, \"myUser\", 42L, \"default\", 1L)", "modifier": "private", "original_string": "private APISessionImpl apiSession = new APISessionImpl(1, new Date(), 100000, \"myUser\", 42L, \"default\", 1L);", "type": "A...
{ "body": "@Test\n public void testAddPagesOfApplication() {\n Set<String> permissions = aSet(\"Perm1\", \"Perm2\");\n doReturn(asList(\"Perm3\", \"Perm4\")).when(applicationAPI).getAllPagesForProfile(\"myProfile1\");\n doReturn(asList(\"Perm4\", \"Perm5\")).when(applicationAPI).getAllPagesFor...
{ "fields": [ { "declarator": "PROFILE_TYPE_AUTHORIZATION_PREFIX = \"profile\"", "modifier": "public static final", "original_string": "public static final String PROFILE_TYPE_AUTHORIZATION_PREFIX = \"profile\";", "type": "String", "var_name": "PROFILE_TYPE_AUTHORIZATION_PREFIX" ...
{ "body": "void addPagesOfApplication(final String profile, final Set<String> pageTokens) {\n final List<String> allPagesForProfile = applicationAPI.getAllPagesForProfile(profile);\n pageTokens.addAll(allPagesForProfile);\n }", "class_method_signature": "PermissionsBuilder.addPagesOfApplication(fin...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_158
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test(expected = ServletException.class)\n public void should_checkValidCondition_catch_runtime() throws ServletException {\n doThrow(new RuntimeException()).when(request).getRequestURI();\n\n //when\n restAPIAuthorizationFilter.checkValidCondition(request, response);\n\n }", "...
{ "fields": [ { "declarator": "SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\"", "modifier": "public static final", "original_string": "public static final String SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\";", "type": "String", "var_name": "SCRIPT_TYPE_AUTHORIZATION_PREFIX" }, ...
{ "body": "@Override\n protected boolean checkValidCondition(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse) throws ServletException {\n try {\n if (httpRequest.getRequestURI().matches(PLATFORM_API_URI_REGEXP)) {\n return platformAPIsCheck(httpRequest,...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_508
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntrySearchDescriptorConverterTest.java", "identifier": "ProfileEntrySearchDescriptorConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = RuntimeException.class)\n public void testTryingToConvertUnexistingDescriptorThrowAnException() {\n new ProfileSearchDescriptorConverter().convert(\"someUnsupportedAttribute\");\n }", "class_method_signature": "ProfileEntrySearchDescriptorConverterTest.testTryingToConvertUne...
{ "fields": [ { "declarator": "mapping", "modifier": "private final", "original_string": "private final Map<String, String> mapping;", "type": "Map<String, String>", "var_name": "mapping" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/entr...
{ "body": "@Override\n public String convert(String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }", "class_method_signature": "ProfileEntrySearchDescriptorConverter.convert(String attribute)", "constructor": false, "full_signature": "@Override public String convert(String attr...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_226
{ "fields": [ { "declarator": "urlBuilder", "modifier": "", "original_string": "UrlBuilder urlBuilder;", "type": "UrlBuilder", "var_name": "urlBuilder" }, { "declarator": "specialULRCharacters = \"!'();:@&=+$,/?# \"", "modifier": "private final static", "ori...
{ "body": "@Test\n public void should_leave_path_with_space_unchanged() throws Exception {\n urlBuilder = new UrlBuilder(\"http://localhost:8080/bonita%20soft?param=value\");\n\n assertThat(urlBuilder.build()).isEqualTo(\"http://localhost:8080/bonita%20soft?param=value\");\n }", "class_method_si...
{ "fields": [ { "declarator": "uriBuilder", "modifier": "private final", "original_string": "private final URIBuilder uriBuilder;", "type": "URIBuilder", "var_name": "uriBuilder" }, { "declarator": "parameters = new LinkedList<>()", "modifier": "private", "o...
{ "body": "public String build() {\n if (!parameters.isEmpty()) {\n uriBuilder.setParameters(parameters);\n }\n return uriBuilder.toString();\n }", "class_method_signature": "UrlBuilder.build()", "constructor": false, "full_signature": "public String build()", "identifier": ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_676
{ "fields": [ { "declarator": "groupAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" }, { "declarator": "groupEngineClient", "modifier": "private", "original_string...
{ "body": "@Test\n public void getPath_return_the_group_path_for_the_specified_group_id() throws Exception {\n Group group = mock(Group.class);\n when(group.getPath()).thenReturn(\"/expected/group/path\");\n when(groupAPI.getGroup(1L)).thenReturn(group);\n \n String groupPath = g...
{ "fields": [ { "declarator": "groupAPI", "modifier": "private", "original_string": "private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/GroupEngineClient.java", "identifier":...
{ "body": "public String getPath(String groupId) {\n try {\n return groupAPI.getGroup(parseId(groupId)).getPath();\n } catch (GroupNotFoundException e) {\n throw new APIException(new _(\"Unable to get group path, group not found\"));\n }\n }", "class_method_signature": ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_699
{ "fields": [ { "declarator": "bdmAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataRef...
{ "body": "@Test\n public void should_return_the_simple_reference_of_the_business_data_of_the_process_instance() throws Exception {\n final SimpleBusinessDataReference reference= buildSimpleEmployeeReference(\"myEmployee\", 487467354L);\n when(bdmAPI.getProcessBusinessDataReference(\"myEmployee\", 48...
{ "fields": [ { "declarator": "bdmAPI", "modifier": "private final", "original_string": "private final BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceReso...
{ "body": "@Get(\"json\")\n public BusinessDataReferenceClient getProcessBusinessDataReference() throws DataNotFoundException {\n final String businessDataName = getPathParam(\"dataName\");\n final Long processInstanceId = getPathParamAsLong(\"caseId\");\n return toClient(bdmAPI.getProcessBusi...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_363
{ "fields": [ { "declarator": "LAYOUT_PAGE_NAME = \"layoutPageName\"", "modifier": "public static final", "original_string": "public static final String LAYOUT_PAGE_NAME = \"layoutPageName\";", "type": "String", "var_name": "LAYOUT_PAGE_NAME" }, { "declarator": "hsReque...
{ "body": "@Test\n public void should_send_not_found_response_when_no_profile_is_mapped_to_application() throws Exception {\n accessAuthorizedPage(\"HumanResources\", \"leavingRequests\");\n given(applicationModel.hasProfileMapped()).willReturn(false);\n\n applicationRouter.route(hsRequest, hs...
{ "fields": [ { "declarator": "applicationModelFactory", "modifier": "private final", "original_string": "private final ApplicationModelFactory applicationModelFactory;", "type": "ApplicationModelFactory", "var_name": "applicationModelFactory" }, { "declarator": "bonita...
{ "body": "public void route(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse, final APISession session, final PageRenderer pageRenderer,\n final ResourceRenderer resourceRenderer, final BonitaHomeFolderAccessor bonitaHomeFolderAccessor)\n throws CreationException, Bonita...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_733
{ "fields": [ { "declarator": "API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\"", "modifier": "public static final", "original_string": "public static final String API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\";", "type": "String", "var_nam...
{ "body": "@Test(expected = NotFoundException.class)\n public void should_unresolved_pageId_throw_exception() throws Exception {\n //given\n final Request request = new Request(Method.POST, \"/bonita/API/extension/myPostResource\");\n final NotFoundException notFoundException = new NotFoundExc...
{ "fields": [ { "declarator": "MAPPING_KEY_SEPARATOR = \"|\"", "modifier": "public static final", "original_string": "public static final String MAPPING_KEY_SEPARATOR = \"|\";", "type": "String", "var_name": "MAPPING_KEY_SEPARATOR" }, { "declarator": "MAPPING_KEY_PREFIX...
{ "body": "public Long resolvePageId(APISession apiSession) throws BonitaException {\n final HttpServletRequest httpServletRequest = getHttpServletRequest();\n final PageReference pageReference;\n pageReference = pageMappingService.getPage(httpServletRequest, apiSession, generateMappingKey(), htt...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_660
{ "fields": [ { "declarator": "engine", "modifier": "@Mock\n private", "original_string": "@Mock\n private IdentityAPI engine;", "type": "IdentityAPI", "var_name": "engine" }, { "declarator": "client", "modifier": "@InjectMocks\n private", "original...
{ "body": "@Test(expected = APIException.class)\n public void should_fail_to_create_a_given_definition_when_engine_throw_an_exception() throws Exception {\n given(engine.createCustomUserInfoDefinition(any(CustomUserInfoDefinitionCreator.class)))\n .willThrow(new CreationException(\"failure\")...
{ "fields": [ { "declarator": "identity", "modifier": "private", "original_string": "private IdentityAPI identity;", "type": "IdentityAPI", "var_name": "identity" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CustomUserInfoEngineClient.java", ...
{ "body": "public CustomUserInfoDefinition createDefinition(CustomUserInfoDefinitionCreator creator) {\n try {\n return identity.createCustomUserInfoDefinition(creator);\n } catch (CreationException e) {\n throw new APIException(new _(\"An error occurred while creating a definition...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_230
{ "fields": [ { "declarator": "DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L", "modifier": "public static final", "original_string": "public static final long DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L;", "type": "long", "var_name": "DATE_01_01_1970_13H_AS_LONG_GMT" }, { ...
{ "body": "@Test\n public void getProcessedInput_when_null_input() throws Exception {\n when(contractDefinition.getInputs()).thenReturn(Collections.<InputDefinition> emptyList());\n\n final Map<String, Serializable> processedInput = contractTypeConverter.getProcessedInput(contractDefinition, null, ma...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(ContractTypeConverter.class.getName())", "modifier": "protected static final", "original_string": "protected static final Logger LOGGER = Logger.getLogger(ContractTypeConverter.class.getName());", "type": "Logger", "var_name": ...
{ "body": "public Map<String, Serializable> getProcessedInput(final ContractDefinition processContract, final Map<String, Serializable> inputs,\n final long maxSizeForTenant, final long tenantId) throws FileNotFoundException {\n this.maxSizeForTenant = maxSizeForTenant;\n this.tenantId = tena...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_725
{ "fields": [ { "declarator": "API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\"", "modifier": "public static final", "original_string": "public static final String API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\";", "type": "String", "var_nam...
{ "body": "@Test\n public void should_post_resolve_class_file_name() throws Exception {\n //given\n final Request request = new Request(Method.POST, \"/bonita/API/extension/myPostResource\");\n final ResourceExtensionResolver resourceExtensionResolver = createSpy(request, \"/bonita/API/extensi...
{ "fields": [ { "declarator": "MAPPING_KEY_SEPARATOR = \"|\"", "modifier": "public static final", "original_string": "public static final String MAPPING_KEY_SEPARATOR = \"|\";", "type": "String", "var_name": "MAPPING_KEY_SEPARATOR" }, { "declarator": "MAPPING_KEY_PREFIX...
{ "body": "public File resolveRestApiControllerFile(PageResourceProviderImpl pageResourceProvider) throws NotFoundException {\n final Properties properties = new Properties();\n\n try (final InputStream resourceAsStream = pageResourceProvider.getResourceAsStream(\"page.properties\");) {\n pro...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_375
{ "fields": [ { "declarator": "hsRequest = new MockHttpServletRequest()", "modifier": "", "original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();", "type": "MockHttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse = ne...
{ "body": "@Test\n public void should_get_badRequest_Status_when_page_name_is_not_set() throws Exception {\n hsRequest.setPathInfo(\"/AppToken/content/\");\n\n servlet.service(hsRequest, hsResponse);\n\n verify(hsResponse).sendError(400, \"The info path is suppose to contain the application to...
{ "fields": [ { "declarator": "RESOURCE_PATH_SEPARATOR = \"/content\"", "modifier": "public static final", "original_string": "public static final String RESOURCE_PATH_SEPARATOR = \"/content\";", "type": "String", "var_name": "RESOURCE_PATH_SEPARATOR" }, { "declarator":...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n final List<String> pathSegments = resourceRenderer.getPathSegments(pathInfo);\n if (isVa...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_18
{ "fields": [ { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest req;", "type": "HttpServletRequest", "var_name": "req" }, { "declarator": "res", "modifier": "@Mock\n private", "original_stri...
{ "body": "@Test\n public void should_verify_authorisation_for_the_given_location_param() throws Exception {\n\n final DocumentDownloadServlet documentDownloadServlet = spy(new DocumentDownloadServlet());\n when(req.getParameter(DocumentDownloadServlet.FILE_PATH_PARAM)).thenReturn(\"../../..\");\n ...
{ "fields": [ { "declarator": "serialVersionUID = 5209516978177786895L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 5209516978177786895L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "PROCE...
{ "body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {\n\n final String filePath = request.getParameter(FILE_PATH_PARAM);\n String fileName = request.getParameter(FILE_NAME_PARAM);\n final String resourcePath ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_119
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedToStartProcess_should_return_true() throws Exception {\n final Map<String, Serializable> parameters = new HashMap<String, Serializable>();\n parameters.put(\"USER_ID_KEY\", 1L);\n parameters.put(\"PROCESS_DEFINITION_ID_KEY\", 42L);\n when(commandA...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedToStartProcess(final APISession apiSession, final long processDefinitionId, final long enforcedUserId) throws BonitaException {\n if (ActivationState.ENABLED.equals(getProcessAPI(apiSession).getProcessDeploymentInfo(processDefinitionId).getActivationState())) {\n f...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_549
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private CaseDocumentDatastore documentDatastore;", "type": "CaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "modifier": "@Moc...
{ "body": "@Test\n public void it_should_not_convert_null_item_return_null() {\n // When\n final CaseDocumentItem convertedEngineToConsoleItem = documentDatastore.convertEngineToConsoleItem(null);\n // Then\n assertTrue(convertedEngineToConsoleItem == null);\n }", "class_method_sig...
{ "fields": [ { "declarator": "constants", "modifier": "protected final", "original_string": "protected final WebBonitaConstantsUtils constants;", "type": "WebBonitaConstantsUtils", "var_name": "constants" }, { "declarator": "processAPI", "modifier": "protected fi...
{ "body": "@Override\n protected CaseDocumentItem convertEngineToConsoleItem(final Document item) {\n if (item != null) {\n return new CaseDocumentItemConverter().convert(item);\n }\n return null;\n }", "class_method_signature": "CaseDocumentDatastore.convertEngineToConsoleItem...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_267
{ "fields": [ { "declarator": "PAGE_ID = 42L", "modifier": "public static final", "original_string": "public static final long PAGE_ID = 42L;", "type": "long", "var_name": "PAGE_ID" }, { "declarator": "pageRenderer", "modifier": "@Mock", "original_string": "...
{ "body": "@Test\n public void should_not_authorize_API_requests_to_other_paths() throws Exception {\n String unauthorizedPath = \"/API/living/../../WEB-INF/web.xml\";\n when(hsRequest.getPathInfo()).thenReturn(\"/process/Test/1.0\" + unauthorizedPath);\n\n pageServlet.service(hsRequest, hsRes...
{ "fields": [ { "declarator": "serialVersionUID = 2789496969243916444L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 2789496969243916444L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGE...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n\n if (!pathInfo.contains(RESOURCE_PATH_SEPARATOR + \"/\") && pathInfo.indexOf(API_PATH_SEPARATO...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_637
{ "fields": [ { "declarator": "TENANT_ID = 1L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 1L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "PAGE_ID = 123l", "modifier": "public static final", ...
{ "body": "@Test\n public void makeSearchOptionCreator_with_ATTRIBUTE_PROCESS_ID_filter_map_should_return_ATTRIBUTE_PROCESS_ID_in_filter_list() {\n final Map<String, String> filters = new HashMap<>();\n final String processID = \"2124654\";\n filters.put(PageItem.ATTRIBUTE_PROCESS_ID, processI...
{ "fields": [ { "declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"", "modifier": "public static final", "original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";", "type": "String", "var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE" }, { "de...
{ "body": "protected SearchOptionsCreator makeSearchOptionCreator(final int page, final int resultsByPage, final String search,\n final String orders,\n final Map<String, String> filters) {\n\n final SearchOptionsCreator searchOptionsCreator = new SearchOptionsCreator(page, resultsByPage,...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_322
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "tenantFolder", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_Logger_log_using_expected_class_name() throws Exception {\n assertEquals(spiedApplicationImportService.getLogger().getName(), \"org.bonitasoft.console.server.service.ApplicationsImportService\");\n }", "class_method_signature": "ApplicationsImportServiceTest.should...
{ "fields": [ { "declarator": "TOKEN = \"/application/import\"", "modifier": "public final static", "original_string": "public final static String TOKEN = \"/application/import\";", "type": "String", "var_name": "TOKEN" }, { "declarator": "FILE_UPLOAD = \"applicationsDa...
{ "body": "@Override\n protected Logger getLogger() {\n return LOGGER;\n }", "class_method_signature": "ApplicationsImportService.getLogger()", "constructor": false, "full_signature": "@Override protected Logger getLogger()", "identifier": "getLogger", "invocations": [], "modifiers": "@Overri...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_288
{ "fields": [ { "declarator": "customPageAuthorizationsHelper", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CustomPageAuthorizationsHelper customPageAuthorizationsHelper;", "type": "CustomPageAuthorizationsHelper", "var_name": "customPageAuthorizationsHelper" ...
{ "body": "@Test\n public void should_authorize_page_when_appToken_is_null_and_page_authorized_in_portal() throws Exception {\n given(getUserRightsHelper.getUserRights()).willReturn(Arrays.asList(\"pageToken\"));\n\n final boolean isPageAuthorized = customPageAuthorizationsHelper.isPageAuthorized(\"\...
{ "fields": [ { "declarator": "BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\"", "modifier": "public static final", "original_string": "public static final String BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\";", "type": "String", "var_name": "BONITA_LABS_PAGE_TOKEN_EXTENSION" ...
{ "body": "public boolean isPageAuthorized(final String appToken, final String pageName) throws BonitaException {\n if (StringUtil.isBlank(appToken)) {\n return isPageAuthorizedInPortal(pageName);\n } else {\n return isPageAuthorizedInApplication(appToken, pageName);\n }\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_772
{ "fields": [ { "declarator": "apiCaseVariable", "modifier": "private", "original_string": "private APICaseVariable apiCaseVariable;", "type": "APICaseVariable", "var_name": "apiCaseVariable" }, { "declarator": "datastore", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void updateUpdateTheVariableValue() throws Exception {\n long caseId = 1L;\n String variableName = \"aName\";\n String newValue = \"newValue\";\n Map<String, String> parameters = buildUpdateParameters(newValue, String.class.getName());\n APIID apiid = bu...
{ "fields": [ { "declarator": "attributeChecker = new APICaseVariableAttributeChecker()", "modifier": "private", "original_string": "private APICaseVariableAttributeChecker attributeChecker = new APICaseVariableAttributeChecker();", "type": "APICaseVariableAttributeChecker", "var_nam...
{ "body": "@Override\n public CaseVariableItem runUpdate(APIID id, Map<String, String> attributes) {\n attributeChecker.checkUpdateAttributes(attributes);\n id.setItemDefinition(CaseVariableDefinition.get());\n CaseVariableItem item = CaseVariableItem.fromIdAndAttributes(id, attributes);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_908
{ "fields": [ { "declarator": "toolkitHttpServlet = new ToolkitHttpServlet() {\n @Override\n protected ServletCall defineServletCall(HttpServletRequest req, HttpServletResponse resp) {\n return null;\n }\n }", "modifier": "", "original_string": "ToolkitHttpServ...
{ "body": "@Test\n public void testIfLocaleIsNotInACookieNorBrowserThatDefaultLocaleIsPassedThrough() throws Exception {\n APIException exception = mock(APIException.class,\n withSettings().defaultAnswer(RETURNS_MOCKS));\n\n doReturn(writer).when(resp).getWriter();\n doReturn(ne...
{ "fields": [ { "declarator": "serialVersionUID = -8470006030459575773L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -8470006030459575773L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "protected final void outputException(final Throwable e, final HttpServletRequest req, final HttpServletResponse resp, final int httpStatusCode) {\n\n if (httpStatusCode >= 0) {\n resp.setStatus(httpStatusCode);\n }\n resp.setContentType(\"application/json;charset=UTF-8\");\n...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_266
{ "fields": [ { "declarator": "PAGE_ID = 42L", "modifier": "public static final", "original_string": "public static final long PAGE_ID = 42L;", "type": "long", "var_name": "PAGE_ID" }, { "declarator": "pageRenderer", "modifier": "@Mock", "original_string": "...
{ "body": "@Test\n public void should_redirect_theme_resource_wihout_app_param() throws Exception {\n when(hsRequest.getPathInfo()).thenReturn(\"/resource/process/Test/1.0/theme/theme.css\");\n when(hsRequest.getParameter(\"app\")).thenReturn(null);\n when(hsRequest.getQueryString()).thenRetur...
{ "fields": [ { "declarator": "serialVersionUID = 2789496969243916444L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 2789496969243916444L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGE...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n\n if (!pathInfo.contains(RESOURCE_PATH_SEPARATOR + \"/\") && pathInfo.indexOf(API_PATH_SEPARATO...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_636
{ "fields": [ { "declarator": "TENANT_ID = 1L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 1L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "PAGE_ID = 123l", "modifier": "public static final", ...
{ "body": "@Test\n public void makeSearchOptionCreator_with_empty_filter_map_should_return_empty_filter_list() {\n final SearchOptionsCreator searchOptionsCreator = pageDatastore.makeSearchOptionCreator(0, 10, \"\",\n \"displayName ASC\", new HashMap<>());\n final List<SearchFilter> fi...
{ "fields": [ { "declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"", "modifier": "public static final", "original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";", "type": "String", "var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE" }, { "de...
{ "body": "protected SearchOptionsCreator makeSearchOptionCreator(final int page, final int resultsByPage, final String search,\n final String orders,\n final Map<String, String> filters) {\n\n final SearchOptionsCreator searchOptionsCreator = new SearchOptionsCreator(page, resultsByPage,...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_323
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "tenantFolder", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_FileReadingError_talk_about_application() throws Exception {\n assertEquals(spiedApplicationImportService.getFileReadingError(), \"Error during Application import file reading.\");\n }", "class_method_signature": "ApplicationsImportServiceTest.should_FileReadingErr...
{ "fields": [ { "declarator": "TOKEN = \"/application/import\"", "modifier": "public final static", "original_string": "public final static String TOKEN = \"/application/import\";", "type": "String", "var_name": "TOKEN" }, { "declarator": "FILE_UPLOAD = \"applicationsDa...
{ "body": "@Override\n protected String getFileReadingError() {\n return _(\"Error during Application import file reading.\");\n }", "class_method_signature": "ApplicationsImportService.getFileReadingError()", "constructor": false, "full_signature": "@Override protected String getFileReadingError()...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_289
{ "fields": [ { "declarator": "customPageAuthorizationsHelper", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CustomPageAuthorizationsHelper customPageAuthorizationsHelper;", "type": "CustomPageAuthorizationsHelper", "var_name": "customPageAuthorizationsHelper" ...
{ "body": "@Test\n public void should_not_authorize_page_when_appToken_is_null_and_page_unauthorized_in_portal() throws Exception {\n given(getUserRightsHelper.getUserRights()).willReturn(Collections.<String>emptyList());\n\n final boolean isPageAuthorized = customPageAuthorizationsHelper.isPageAutho...
{ "fields": [ { "declarator": "BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\"", "modifier": "public static final", "original_string": "public static final String BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\";", "type": "String", "var_name": "BONITA_LABS_PAGE_TOKEN_EXTENSION" ...
{ "body": "public boolean isPageAuthorized(final String appToken, final String pageName) throws BonitaException {\n if (StringUtil.isBlank(appToken)) {\n return isPageAuthorizedInPortal(pageName);\n } else {\n return isPageAuthorizedInApplication(appToken, pageName);\n }\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_773
{ "fields": [ { "declarator": "apiCaseVariable", "modifier": "private", "original_string": "private APICaseVariable apiCaseVariable;", "type": "APICaseVariable", "var_name": "apiCaseVariable" }, { "declarator": "datastore", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void searchIsFilteredByCaseId() throws Exception {\n long expectedCaseId = 1L;\n Map<String, String> filters = buildCaseIdFilter(expectedCaseId);\n\n apiCaseVariable.runSearch(0, 10, null, null, filters, null, null);\n\n verify(datastore).findByCaseId(expectedC...
{ "fields": [ { "declarator": "attributeChecker = new APICaseVariableAttributeChecker()", "modifier": "private", "original_string": "private APICaseVariableAttributeChecker attributeChecker = new APICaseVariableAttributeChecker();", "type": "APICaseVariableAttributeChecker", "var_nam...
{ "body": "@Override\n public ItemSearchResult<CaseVariableItem> runSearch(int page, int resultsByPage, String search, String orders,\n Map<String, String> filters, List<String> deploys, List<String> counters) {\n attributeChecker.checkSearchFilters(filters);\n long caseId = Long.valueOf(f...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_19
{ "fields": [ { "declarator": "engineEvaluator", "modifier": "@Mock", "original_string": "@Mock\n ExpressionEvaluatorEngineClient engineEvaluator;", "type": "ExpressionEvaluatorEngineClient", "var_name": "engineEvaluator" }, { "declarator": "processInstanceAccessor",...
{ "body": "@Test\n public void testEvaluateExpressionOnCompletedProcessInstance() throws Exception {\n when(processInstance.getId()).thenReturn(2L);\n when(processInstance.isArchived()).thenReturn(true);\n\n when(engineEvaluator.evaluateExpressionsOnCompletedProcessInstance(2L, someExpressions...
{ "fields": [ { "declarator": "engineEvaluator", "modifier": "private", "original_string": "private ExpressionEvaluatorEngineClient engineEvaluator;", "type": "ExpressionEvaluatorEngineClient", "var_name": "engineEvaluator" } ], "file": "forms/forms-server/src/main/java/org/b...
{ "body": "public Map<String, Serializable> evaluate(ProcessInstanceAccessor instance,\n final Map<Expression, Map<String, Serializable>> expressions,\n boolean atProcessInstanciation)\n\n throws BPMEngineException, BPMExpressionEvaluationException {\n\n if (atProcessInstanciat...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_118
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedToSeeProcessInstance_should_return_false() throws Exception {\n when(processAPI.isInvolvedInProcessInstance(1L, 42L)).thenReturn(false);\n\n final boolean isAllowedToSeeProcessInstance = processFormService.isAllowedToSeeProcessInstance(apiSession, 42L, 1L);\n\n...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedToSeeProcessInstance(final APISession apiSession, final long processInstanceId,\n final long enforcedUserId) throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n return processAPI.isInvolvedInProcessInstance(enforcedUserId, p...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_548
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private CaseDocumentDatastore documentDatastore;", "type": "CaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "modifier": "@Moc...
{ "body": "@Test\n public void it_should_convert_item_return_item() throws Exception {\n // When\n final CaseDocumentItem convertedEngineToConsoleItem = documentDatastore.convertEngineToConsoleItem(mockedDocument);\n // Then\n assertTrue(convertedEngineToConsoleItem != null);\n }", ...
{ "fields": [ { "declarator": "constants", "modifier": "protected final", "original_string": "protected final WebBonitaConstantsUtils constants;", "type": "WebBonitaConstantsUtils", "var_name": "constants" }, { "declarator": "processAPI", "modifier": "protected fi...
{ "body": "@Override\n protected CaseDocumentItem convertEngineToConsoleItem(final Document item) {\n if (item != null) {\n return new CaseDocumentItemConverter().convert(item);\n }\n return null;\n }", "class_method_signature": "CaseDocumentDatastore.convertEngineToConsoleItem...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_661
{ "fields": [ { "declarator": "engine", "modifier": "@Mock\n private", "original_string": "@Mock\n private IdentityAPI engine;", "type": "IdentityAPI", "var_name": "engine" }, { "declarator": "client", "modifier": "@InjectMocks\n private", "original...
{ "body": "@Test\n public void should_delete_a_given_definition() throws Exception {\n\n client.deleteDefinition(1L);\n\n verify(engine).deleteCustomUserInfoDefinition(1L);\n }", "class_method_signature": "CustomUserInfoEngineClientTest.should_delete_a_given_definition()", "constructor": false...
{ "fields": [ { "declarator": "identity", "modifier": "private", "original_string": "private IdentityAPI identity;", "type": "IdentityAPI", "var_name": "identity" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CustomUserInfoEngineClient.java", ...
{ "body": "public void deleteDefinition(long id) {\n try {\n identity.deleteCustomUserInfoDefinition(id);\n } catch (DeletionException e) {\n throw new APIException(new _(\"An error occurred while deleting an item with the id %id%\", new Arg(\"id\", id)), e);\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_231
{ "fields": [ { "declarator": "DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L", "modifier": "public static final", "original_string": "public static final long DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L;", "type": "long", "var_name": "DATE_01_01_1970_13H_AS_LONG_GMT" }, { ...
{ "body": "@Test\n public void getProcessedInputs_with_invalid_inputs_should_return_unmodified_inputs() throws Exception {\n final List<InputDefinition> inputDefinition = generateSimpleInputDefinition(false);\n when(contractDefinition.getInputs()).thenReturn(inputDefinition);\n final Map<Strin...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(ContractTypeConverter.class.getName())", "modifier": "protected static final", "original_string": "protected static final Logger LOGGER = Logger.getLogger(ContractTypeConverter.class.getName());", "type": "Logger", "var_name": ...
{ "body": "public Map<String, Serializable> getProcessedInput(final ContractDefinition processContract, final Map<String, Serializable> inputs,\n final long maxSizeForTenant, final long tenantId) throws FileNotFoundException {\n this.maxSizeForTenant = maxSizeForTenant;\n this.tenantId = tena...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_724
{ "fields": [ { "declarator": "RETURN_VALUE = \"{'return':'value'}\"", "modifier": "public static final", "original_string": "public static final String RETURN_VALUE = \"{'return':'value'}\";", "type": "String", "var_name": "RETURN_VALUE" }, { "declarator": "GET = \"GET...
{ "body": "@Test\n public void should_handle_content_disposition_with_restlet_range() throws Exception {\n //given\n method = new Method(GET);\n doReturn(method).when(request).getMethod();\n final RestApiResponse restApiResponse = new RestApiResponseBuilder()\n .withAddit...
{ "fields": [ { "declarator": "EMPTY_RESPONSE = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_RESPONSE = \"\";", "type": "String", "var_name": "EMPTY_RESPONSE" }, { "declarator": "restApiRenderer", "modifier": "priv...
{ "body": "@Override\n public Representation doHandle() {\n final StringRepresentation stringRepresentation = new StringRepresentation(EMPTY_RESPONSE);\n try {\n final RestApiResponse restApiResponse = handleRequest();\n fillAllContent(stringRepresentation, restApiResponse);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_374
{ "fields": [ { "declarator": "hsRequest = new MockHttpServletRequest()", "modifier": "", "original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();", "type": "MockHttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse = ne...
{ "body": "@Test\n public void should_get_Forbidden_Status_when_page_unAuthorize() throws Exception {\n hsRequest.setPathInfo(\"/AppToken/pageToken/content/\");\n given(resourceRenderer.getPathSegments(\"/AppToken/pageToken/content/\")).willReturn(Arrays.asList(\"AppToken\", \"pageToken\", \"content\...
{ "fields": [ { "declarator": "RESOURCE_PATH_SEPARATOR = \"/content\"", "modifier": "public static final", "original_string": "public static final String RESOURCE_PATH_SEPARATOR = \"/content\";", "type": "String", "var_name": "RESOURCE_PATH_SEPARATOR" }, { "declarator":...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n final List<String> pathSegments = resourceRenderer.getPathSegments(pathInfo);\n if (isVa...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_227
{ "fields": [ { "declarator": "urlBuilder", "modifier": "", "original_string": "UrlBuilder urlBuilder;", "type": "UrlBuilder", "var_name": "urlBuilder" }, { "declarator": "specialULRCharacters = \"!'();:@&=+$,/?# \"", "modifier": "private final static", "ori...
{ "body": "@Test\n public void should_leave_URL_without_querystring_unchanged() throws Exception {\n urlBuilder = new UrlBuilder(\"http://localhost:8080/bonita/homepage\");\n\n assertThat(urlBuilder.build()).isEqualTo(\"http://localhost:8080/bonita/homepage\");\n }", "class_method_signature": "U...
{ "fields": [ { "declarator": "uriBuilder", "modifier": "private final", "original_string": "private final URIBuilder uriBuilder;", "type": "URIBuilder", "var_name": "uriBuilder" }, { "declarator": "parameters = new LinkedList<>()", "modifier": "private", "o...
{ "body": "public String build() {\n if (!parameters.isEmpty()) {\n uriBuilder.setParameters(parameters);\n }\n return uriBuilder.toString();\n }", "class_method_signature": "UrlBuilder.build()", "constructor": false, "full_signature": "public String build()", "identifier": ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_677
{ "fields": [ { "declarator": "groupAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" }, { "declarator": "groupEngineClient", "modifier": "private", "original_string...
{ "body": "@Test\n public void create_create_a_group_in_engine_repository() throws Exception {\n GroupCreator creator = new GroupCreator(\"aName\");\n \n groupEngineClient.create(creator);\n \n verify(groupAPI).createGroup(creator);\n }", "class_method_signature": "GroupEngi...
{ "fields": [ { "declarator": "groupAPI", "modifier": "private", "original_string": "private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/GroupEngineClient.java", "identifier":...
{ "body": "public Group create(GroupCreator groupCreator) {\n try {\n return groupAPI.createGroup(groupCreator);\n } catch (AlreadyExistsException e) {\n throw new APIException(new _(\n \"Can't create group. Group '%groupName%' already exists\",\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_698
{ "fields": [ { "declarator": "bdmAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataRef...
{ "body": "@Test\n public void should_return_the_references_of_the_business_data_of_the_process_instance() throws Exception {\n final List<BusinessDataReference> references = new ArrayList<BusinessDataReference>();\n references.add(buildSimpleEmployeeReference(\"john\", 487467354L));\n referen...
{ "fields": [ { "declarator": "bdmAPI", "modifier": "private final", "original_string": "private final BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferencesRes...
{ "body": "@Get(\"json\")\n public List<BusinessDataReference> getProcessBusinessDataReferences() {\n final Long processInstanceId = getCaseId();\n final Integer p = getSearchPageNumber();\n final Integer c = getSearchPageSize();\n return bdmAPI.getProcessBusinessDataReferences(processI...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_362
{ "fields": [ { "declarator": "LAYOUT_PAGE_NAME = \"layoutPageName\"", "modifier": "public static final", "original_string": "public static final String LAYOUT_PAGE_NAME = \"layoutPageName\";", "type": "String", "var_name": "LAYOUT_PAGE_NAME" }, { "declarator": "hsReque...
{ "body": "@Test\n public void should_not_forward_to_the_application_page_template_when_user_is_not_authorized() throws Exception {\n accessUnauthorizedPage(\"HumanResources\", \"leavingRequests\");\n\n applicationRouter.route(hsRequest, hsResponse, apiSession, pageRenderer, resourceRenderer, bonitaH...
{ "fields": [ { "declarator": "applicationModelFactory", "modifier": "private final", "original_string": "private final ApplicationModelFactory applicationModelFactory;", "type": "ApplicationModelFactory", "var_name": "applicationModelFactory" }, { "declarator": "bonita...
{ "body": "public void route(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse, final APISession session, final PageRenderer pageRenderer,\n final ResourceRenderer resourceRenderer, final BonitaHomeFolderAccessor bonitaHomeFolderAccessor)\n throws CreationException, Bonita...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_732
{ "fields": [ { "declarator": "API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\"", "modifier": "public static final", "original_string": "public static final String API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\";", "type": "String", "var_nam...
{ "body": "@Test\n public void should_mapping_key_exclude_parameters() throws Exception {\n //given\n final Request request = new Request(Method.GET, \"/bonita/API/extension/helloWorld?param1=a&param2=b\");\n final ResourceExtensionResolver resourceExtensionResolver = createSpy(request, \"/bon...
{ "fields": [ { "declarator": "MAPPING_KEY_SEPARATOR = \"|\"", "modifier": "public static final", "original_string": "public static final String MAPPING_KEY_SEPARATOR = \"|\";", "type": "String", "var_name": "MAPPING_KEY_SEPARATOR" }, { "declarator": "MAPPING_KEY_PREFIX...
{ "body": "public String generateMappingKey() {\n final StringBuilder builder = new StringBuilder();\n final String requestAsString = getHttpServletRequest().getRequestURI();\n final String pathTemplate = StringUtils.substringAfter(requestAsString, API_EXTENSION_TEMPLATE_PREFIX);\n\n build...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_58
{ "fields": [ { "declarator": "apiSession = new APISessionImpl(1, new Date(), 100000, \"myUser\", 42L, \"default\", 1L)", "modifier": "private", "original_string": "private APISessionImpl apiSession = new APISessionImpl(1, new Date(), 100000, \"myUser\", 42L, \"default\", 1L);", "type": "A...
{ "body": "@Test\n public void should_getCustomPermissions_work_with_compound_permissions() {\n doReturn(aSet(\"Perm1\", \"Perm2\", \"taskListing\")).when(customPermissionsMapping).getPropertyAsSet(\"user|myUser\");\n doReturn(aSet(\"Perm3\", \"Perm4\")).when(compoundPermissionsMapping).getPropertyAs...
{ "fields": [ { "declarator": "PROFILE_TYPE_AUTHORIZATION_PREFIX = \"profile\"", "modifier": "public static final", "original_string": "public static final String PROFILE_TYPE_AUTHORIZATION_PREFIX = \"profile\";", "type": "String", "var_name": "PROFILE_TYPE_AUTHORIZATION_PREFIX" ...
{ "body": "Set<String> getCustomPermissions(final String type, final String identifier) {\n final Set<String> profileSinglePermissions = new HashSet<>();\n final Set<String> customPermissionsForEntity = getCustomPermissionsRaw(type, identifier);\n for (final String customPermissionForEntity : cus...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_159
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test\n public void checkResourceAuthorizationsSyntax_should_return_false_if_syntax_is_invalid() throws Exception {\n final RestAPIAuthorizationFilter restAPIAuthorizationFilterSpy = spy(restAPIAuthorizationFilter);\n final Set<String> resourceAuthorizations = new HashSet<String>();\n ...
{ "fields": [ { "declarator": "SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\"", "modifier": "public static final", "original_string": "public static final String SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\";", "type": "String", "var_name": "SCRIPT_TYPE_AUTHORIZATION_PREFIX" }, ...
{ "body": "protected boolean checkResourceAuthorizationsSyntax(final Set<String> resourceAuthorizations) {\n boolean valid = true;\n for (final String resourceAuthorization : resourceAuthorizations) {\n if (!resourceAuthorization.matches(\"(\" + PermissionsBuilder.USER_TYPE_AUTHORIZATION_PREF...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_509
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileItemConverterTest.java", "identifier": "ProfileItemConverterTest", "interfaces": "", "superclass": "extends APITestWithMock" }
{ "body": "@Test\n public void testProfileItemConvertion() {\n final Profile profile = anEngineProfile().withName(\"aName\").withDescription(\"aDescription\").build();\n\n final ProfileItem item = new ProfileItemConverter().convert(profile);\n\n assertTrue(areEquals(aProfileItem().fromEngineIt...
{ "fields": [ { "declarator": "USER_PROFILE_NAME = \"User\"", "modifier": "public static final", "original_string": "public static final String USER_PROFILE_NAME = \"User\";", "type": "String", "var_name": "USER_PROFILE_NAME" }, { "declarator": "ADMIN_PROFILE_NAME = \"A...
{ "body": "@Override\n public ProfileItem convert(final Profile profile) {\n final ProfileItem item = new ProfileItem();\n item.setId(profile.getId());\n item.setName(profile.getName());\n item.setDescription(profile.getDescription());\n item.setIsDefault(profile.isDefault());\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_620
{ "fields": [ { "declarator": "TENANT_ID = 1L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 1L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "PAGE_ID = 123l", "modifier": "public static final", ...
{ "body": "@Test(expected = APIException.class)\n public void should_add_a_not_valid_page_rise_exception() {\n // Given\n deleteDir(pagesDir);\n final URL zipFileUrl = getClass().getResource(\"/InvalidPage.zip\");\n pageToBeAdded.setAttribute(PageDatastore.UNMAPPED_ATTRIBUTE_ZIP_FILE, z...
{ "fields": [ { "declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"", "modifier": "public static final", "original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";", "type": "String", "var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE" }, { "de...
{ "body": "@Override\n public PageItem add(final PageItem pageItem) {\n final String zipFileAttribute = pageItem.getAttributeValue(UNMAPPED_ATTRIBUTE_ZIP_FILE);\n final String[] filenames = zipFileAttribute.split(FileUploadServlet.RESPONSE_SEPARATOR);\n final String filename = filenames[0];\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_270
{ "fields": [ { "declarator": "PAGE_NAME = \"pageName\"", "modifier": "public static final", "original_string": "public static final String PAGE_NAME = \"pageName\";", "type": "String", "var_name": "PAGE_NAME" }, { "declarator": "PROCESS_DEFINITION_ID = 123L", "mo...
{ "body": "@Test\n public void should_temp_page_file_be_distinct() throws Exception {\n assertThat(pageResourceProvider.getTempPageFile()).as(\"should be page name\").isNotEqualTo(pageResourceProviderWithProcessDefinition.getTempPageFile());\n }", "class_method_signature": "PageResourceProviderImplTest...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(PageResourceProviderImpl.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(PageResourceProviderImpl.class.getName());", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "public File getTempPageFile() {\n return pageTempFile;\n }", "class_method_signature": "PageResourceProviderImpl.getTempPageFile()", "constructor": false, "full_signature": "public File getTempPageFile()", "identifier": "getTempPageFile", "invocations": [], "modifiers": "public", "p...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_765
{ "fields": [ { "declarator": "attributeChecker", "modifier": "private", "original_string": "private APICaseVariableAttributeChecker attributeChecker;", "type": "APICaseVariableAttributeChecker", "var_name": "attributeChecker" } ], "file": "server/src/test/java/org/bonitasoft...
{ "body": "@Test\n public void checkUpdateAttributesPassForSuitableValues() throws Exception {\n Map<String, String> attributes = buildSuitableUpdateAttributes();\n\n attributeChecker.checkUpdateAttributes(attributes);\n }", "class_method_signature": "APICaseVariableAttributeCheckerTest.checkUpd...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/cases/APICaseVariableAttributeChecker.java", "identifier": "APICaseVariableAttributeChecker", "interfaces": "", "methods": [ { "class_method_signature": "APICaseVariableAttributeChecker.checkUpdateAttributes(Map<Str...
{ "body": "public void checkUpdateAttributes(Map<String, String> attributes) {\n if (attributes == null || attributes.isEmpty()) {\n throw new APIException(format(\"Attributes '%s' and '%s' must be specified\", CaseVariableItem.ATTRIBUTE_TYPE, CaseVariableItem.ATTRIBUTE_VALUE));\n }\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_335
{ "fields": [ { "declarator": "collector = new RootMenuCollector()", "modifier": "", "original_string": "RootMenuCollector collector = new RootMenuCollector();", "type": "RootMenuCollector", "var_name": "collector" }, { "declarator": "menu = new ApplicationMenuImpl(\"na...
{ "body": "@Test\n public void should_be_collectible_when_the_menu_has_no_parentId() {\n menu.setParentId(null);\n\n assertThat(collector.isCollectible(menu)).isTrue();\n }", "class_method_signature": "RootMenuCollectorTest.should_be_collectible_when_the_menu_has_no_parentId()", "constructor":...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/livingapps/menu/RootMenuCollector.java", "identifier": "RootMenuCollector", "interfaces": "implements Collector", "methods": [ { "class_method_signature": "RootMenuCollector.isCollectible(final ApplicationMenu menu)", "constructor": ...
{ "body": "@Override\n public boolean isCollectible(final ApplicationMenu menu) {\n return menu.getParentId() == null;\n }", "class_method_signature": "RootMenuCollector.isCollectible(final ApplicationMenu menu)", "constructor": false, "full_signature": "@Override public boolean isCollectible(final...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_821
{ "fields": [ { "declarator": "PROCESS_DEFINITION_ID = 4L", "modifier": "private static final", "original_string": "private static final long PROCESS_DEFINITION_ID = 4L;", "type": "long", "var_name": "PROCESS_DEFINITION_ID" }, { "declarator": "TEST_DESIGN_API_URL = \"/b...
{ "body": "@Test\n public void testReplaceLongIdToString() throws Exception {\n assertThat(processDefinitionDesignResource.replaceLongIdToString(\"{ \\\"id\\\": 123}\")).isEqualToIgnoringCase(\"{ \\\"id\\\": \\\"123\\\"}\");\n assertThat(processDefinitionDesignResource.replaceLongIdToString(\"{ \\\"i...
{ "fields": [ { "declarator": "PROCESS_DEFINITION_ID = \"processDefinitionId\"", "modifier": "private static final", "original_string": "private static final String PROCESS_DEFINITION_ID = \"processDefinitionId\";", "type": "String", "var_name": "PROCESS_DEFINITION_ID" }, { ...
{ "body": "protected String replaceLongIdToString(final String design) throws IOException {\n return design.replaceAll(\"([^\\\\\\\\]\\\"id\\\"\\\\s*:\\\\s*)(\\\\d+)\", \"$1\\\"$2\\\"\");\n }", "class_method_signature": "ProcessDefinitionDesignResource.replaceLongIdToString(final String design)", "const...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_122
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedAsAdminOrProcessSupervisor_should_return_false() throws Exception {\n final long processDefinitionId = 2L;\n final Set<String> userPermissions = new HashSet<String>();\n when(httpSession.getAttribute(SessionUtil.PERMISSIONS_SESSION_PARAM_KEY)).thenReturn...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedAsAdminOrProcessSupervisor(final HttpServletRequest request, final APISession apiSession, final long processDefinitionId,\n final long taskInstanceId, final long userId, final boolean assignTask) throws BonitaException {\n if (isLoggedUserAdmin(request) || isLogged...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_572
{ "fields": [ { "declarator": "spiedDatastore = new ConnectorInstanceDatastore(null)", "modifier": "@Spy\n private final", "original_string": "@Spy\n private final ConnectorInstanceDatastore spiedDatastore = new ConnectorInstanceDatastore(null);", "type": "ConnectorInstanceDatastore"...
{ "body": "@Test\n public void searchReturnAllItems() throws Exception {\n final ConnectorInstance connectorInstance1 = createConnectorInstanceImpl(1L, \"instance 1\");\n final ConnectorInstance connectorInstance2 = createConnectorInstanceImpl(1L, \"instance 2\");\n final SearchResult<Connecto...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/connector/ConnectorInstanceDatastore.java", "identifier": "ConnectorInstanceDatastore", "interfaces": "implements DatastoreHasSearch<ConnectorInstanceItem>", "methods": [ { "class_method_signature": "Connector...
{ "body": "@Override\n public ItemSearchResult<ConnectorInstanceItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n SearchResult<ConnectorInstance> searchConnectorInstances;\n try {\n searchCo...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_23
{ "fields": [ { "declarator": "util = new FormFieldValuesUtil()", "modifier": "", "original_string": "FormFieldValuesUtil util = new FormFieldValuesUtil();", "type": "FormFieldValuesUtil", "var_name": "util" } ], "file": "forms/forms-server/src/test/java/org/bonitasoft/forms/...
{ "body": "@Test\n public void testWeRetrieveExpressionOfWidgetWithoutDisplayExpressions() throws Exception {\n final List<FormWidget> widgets = Arrays.asList(aWidgetWithLabelExpression(\"widget\"));\n\n final List<Expression> expressions = util.getExpressionsToEvaluation(\n widgets,\n...
{ "fields": [ { "declarator": "INDEX_SEPARATOR = \"_\"", "modifier": "protected static final", "original_string": "protected static final String INDEX_SEPARATOR = \"_\";", "type": "String", "var_name": "INDEX_SEPARATOR" }, { "declarator": "WIDGET_LABEL = \"label\"", ...
{ "body": "protected List<Expression> getExpressionsToEvaluation(final List<FormWidget> widgets,\n final Map<String, Serializable> resolvedDisplayExp,\n final Map<String, Object> context) {\n final List<Expression> expressionsToEvaluate = new ArrayList<Expression>();\n for (final F...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_437
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "pageAPI", "modifier": "@Mock\n p...
{ "body": "@Test(expected = APIException.class)\n public void should_return_throw_APIException_on_get_when_engine_throws_exception() throws Exception {\n //given\n given(applicationAPI.getApplication(1)).willThrow(new ApplicationNotFoundException(1));\n\n //when\n dataStore.get(APIID.ma...
{ "fields": [ { "declarator": "applicationAPI", "modifier": "private final", "original_string": "private final ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "converter", "modifier": "private final", ...
{ "body": "@Override\n public ApplicationItem get(final APIID id) {\n try {\n final Application application = applicationAPI.getApplication(id.toLong());\n return converter.toApplicationItem(application);\n } catch (final Exception e) {\n throw new APIException(e);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_525
{ "fields": [ { "declarator": "session", "modifier": "@Mock\n private", "original_string": "@Mock\n private APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "applicationAPI", "modifier": "@Mock\n private", "origin...
{ "body": "@Test(expected = APIException.class)\n public void should_throw_APIException_when_engine_throws_SearchException_on_search() throws Exception {\n //given\n final String orders = ApplicationPageItem.ATTRIBUTE_TOKEN + \" DESC\";\n given(applicationAPI.searchApplicationPages(any(SearchO...
{ "fields": [ { "declarator": "applicationAPI", "modifier": "private final", "original_string": "private final ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "pageAPI", "modifier": "private final", ...
{ "body": "@Override\n public ItemSearchResult<ApplicationPageItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n final SearchOptionsCreator creator = makeSearchOptionCreator(page, resultsByPage, search, orders, ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_175
{ "fields": [ { "declarator": "request", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" }, { "declarator": "requestAccessor", "modifier": "@Mock", "original_string": "@Moc...
{ "body": "@Test\n public void testSanitizeLoginPageUrlShouldReturnCorrectUrl() throws Exception {\n String loginPage = logoutServlet.sanitizeLoginPageUrl(\"portal/homepage?p=test#poutpout\");\n \n assertThat(loginPage).isEqualToIgnoringCase(\"portal/homepage?p=test#poutpout\");\n }", "cl...
{ "fields": [ { "declarator": "serialVersionUID = 739607235407639011L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 739607235407639011L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGIN_P...
{ "body": "protected String sanitizeLoginPageUrl(final String loginURL) {\n return new RedirectUrlBuilder(new URLProtector().protectRedirectUrl(loginURL)).build().getUrl();\n }", "class_method_signature": "LogoutServlet.sanitizeLoginPageUrl(final String loginURL)", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_876
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private DateConverter converter;", "type": "DateConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/DateConv...
{ "body": "@Test\n public void shouldConvertDateStringIntoDate() throws Exception {\n\n Calendar c = Calendar.getInstance();\n int hourOfDay = 11;\n int minute = 43;\n int second = 30;\n int dayOfDateate = 18;\n int year = 2014;\n c.set(year, Calendar.AUGUST, dayOfD...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/DateConverter.java", "identifier": "DateConverter", "interfaces": "implements Converter<Date>", "methods": [ { "class_method_signature": "DateConverter.convert(String toBeConverted)", "...
{ "body": "@Override\n public Date convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss z yyyy\", DateForma...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_899
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private ConverterFactory factory;", "type": "ConverterFactory", "var_name": "factory" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConverterFacto...
{ "body": "@Test\n public void factoryCreateALongConverterForLongClassName() throws Exception {\n \n Converter<?> createConverter = factory.createConverter(Long.class.getName());\n \n assertTrue(createConverter instanceof LongConverter);\n }", "class_method_signature": "ConverterFa...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConverterFactory.java", "identifier": "ConverterFactory", "interfaces": "", "methods": [ { "class_method_signature": "ConverterFactory.createConverter(String className)", "constructor": false...
{ "body": "public Converter<?> createConverter(String className) {\n if (isClass(String.class, className)) {\n return new StringConverter();\n } else if (isClass(Date.class, className)) {\n return new DateConverter();\n } else if (isClass(Double.class, className)) {\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_460
{ "fields": [ { "declarator": "converter = new ApplicationSearchDescriptorConverter()", "modifier": "private final", "original_string": "private final ApplicationSearchDescriptorConverter converter = new ApplicationSearchDescriptorConverter();", "type": "ApplicationSearchDescriptorConverte...
{ "body": "@Test\n public void should_return_ApplicationSearchDescriptor_layoutid_on_convert_attribute_layoutid() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_LAYOUT_ID);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescript...
{ "fields": [ { "declarator": "mapping", "modifier": "private final", "original_string": "private final Map<String, String> mapping;", "type": "Map<String, String>", "var_name": "mapping" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/...
{ "body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }", "class_method_signature": "ApplicationSearchDescriptorConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String convert(...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_74
{ "fields": [ { "declarator": "request", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" } ], "file": "common/src/test/java/org/bonitasoft/console/common/server/utils/Lo...
{ "body": "@Test\n public void testWeCanRetrieveLocaleFromRequest() throws Exception {\n Cookie[] cookies = {\n new Cookie(LocaleUtils.LOCALE_COOKIE_NAME, \"en_US\"),\n };\n doReturn(cookies).when(request).getCookies();\n\n String locale = LocaleUtils.getUserLocaleAsStrin...
{ "fields": [ { "declarator": "LOCALE_PARAM = \"locale\"", "modifier": "public static final", "original_string": "public static final String LOCALE_PARAM = \"locale\";", "type": "String", "var_name": "LOCALE_PARAM" }, { "declarator": "PORTAL_LOCALE_PARAM = \"_l\"", ...
{ "body": "public static String getUserLocaleAsString(final HttpServletRequest request) {\n String locale = getLocaleFromRequestURL(request);\n if (locale == null) {\n locale = getStandardizedLocaleFromCookie(request);\n }\n if (locale == null) {\n String browserLocal...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_319
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "tenantFolder", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_importFileContent_call_ApplicationAPI_with_valid_param() throws Exception {\n spiedApplicationImportService.importFileContent(new byte[0], \"FAIL_ON_DUPLICATES\");\n verify(applicationAPI).importApplications(new byte[0], ApplicationImportPolicy.FAIL_ON_DUPLICATES...
{ "fields": [ { "declarator": "TOKEN = \"/application/import\"", "modifier": "public final static", "original_string": "public final static String TOKEN = \"/application/import\";", "type": "String", "var_name": "TOKEN" }, { "declarator": "FILE_UPLOAD = \"applicationsDa...
{ "body": "@Override\n public ImportStatusMessages importFileContent(final byte[] fileContent, final String importPolicyAsString) throws ExecutionException, ImportException, AlreadyExistsException, InvalidSessionException, BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException {\n final Appl...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_749
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock", "original_string": "@Mock\n ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "restResource", "modifier": "private", "original_string": "private BPMM...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void sendMessage_should_throw_exception_if_engine_throws_SendEventException() throws Exception {\n // given:\n doThrow(SendEventException.class).when(processAPI).sendMessage(anyString(), any(Expression.class),\n any(E...
{ "fields": [ { "declarator": "SUPPORTED_TYPES = new HashSet<>()", "modifier": "private static final", "original_string": "private static final Set<String> SUPPORTED_TYPES = new HashSet<>();", "type": "Set<String>", "var_name": "SUPPORTED_TYPES" }, { "declarator": "proc...
{ "body": "@Post(\"json\")\n public void sendMessage(BPMMessage message) {\n validateMandatoryAttributes(message);\n try {\n Map<Expression, Expression> msgContent = new HashMap<>();\n if (message.getMessageContent() != null) {\n for (Map.Entry<String, BPMMessageV...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_860
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/json/JSonSimpleDeserializerTest.java", "identifier": "JSonSimpleDeserializerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEmptyObject() {\n final AbstractTreeNode<String> tree = JSonSimpleDeserializer.unserializeTree(\"{}\");\n\n if (!(tree instanceof TreeIndexed<?>)) {\n fail(\"Fail to parse a simple object in JSON\");\n }\n\n assertEquals(\"{}\", tree.toJson(...
{ "fields": [ { "declarator": "INSTANCE = null", "modifier": "private static", "original_string": "private static JSonSimpleDeserializer INSTANCE = null;", "type": "JSonSimpleDeserializer", "var_name": "INSTANCE" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/serv...
{ "body": "public static AbstractTreeNode<String> unserializeTree(final String json) {\n\n return getInstance()._unserializeTree(json);\n }", "class_method_signature": "JSonSimpleDeserializer.unserializeTree(final String json)", "constructor": false, "full_signature": "public static AbstractTreeNode<S...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_499
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileSearchDescriptorConverterTest.java", "identifier": "ProfileSearchDescriptorConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = RuntimeException.class)\n public void testTryingToConvertUnexistingDescriptorThrowAnException() {\n new ProfileSearchDescriptorConverter().convert(\"someUnsupportedAttribute\");\n }", "class_method_signature": "ProfileSearchDescriptorConverterTest.testTryingToConvertUnexisti...
{ "fields": [ { "declarator": "mapping = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, String> mapping = new HashMap<>();", "type": "Map<String, String>", "var_name": "mapping" } ], "file": "server/src/main/java/org...
{ "body": "@Override\n public String convert(String attribute) {\n String descriptor = mapping.get(attribute);\n if (descriptor == null) {\n throw new RuntimeException(attribute + \" has no valid search descriptor\");\n }\n return descriptor;\n }", "class_method_signatur...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_163
{ "fields": [ { "declarator": "request", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" } ], "file": "server/src/test/java/org/bonitasoft/console/common/server/login/filter/MultiReadHttpSer...
{ "body": "@Test\n public void should_getInputStream_work_when_called_twice() throws Exception {\n\n ServletInputStream fakeInputStream = null;\n try {\n fakeInputStream = new FakeServletInputStream();\n doReturn(fakeInputStream).when(request).getInputStream();\n fina...
{ "fields": [ { "declarator": "readBytes", "modifier": "private", "original_string": "private ByteArrayOutputStream readBytes;", "type": "ByteArrayOutputStream", "var_name": "readBytes" } ], "file": "server/src/main/java/org/bonitasoft/console/common/server/login/filter/Multi...
{ "body": "@Override\n public ServletInputStream getInputStream() throws IOException {\n if (readBytes == null) {\n readInputStream();\n }\n return new CachedServletInputStream();\n }", "class_method_signature": "MultiReadHttpServletRequest.getInputStream()", "constructor": f...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_533
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/ArchivedCaseDocumentItemConverterTest.java", "identifier": "ArchivedCaseDocumentItemConverterTest", "interfaces": "", "superclass": "extends APITestWithMock" }
{ "body": "@Test\n public void should_convert_engine_document_into_portal_document() {\n\n // Given\n final ArchivedCaseDocumentItemConverter documentItemConverter = new ArchivedCaseDocumentItemConverter();\n final ArchivedDocument engineItem = mock(ArchivedDocument.class);\n when(engin...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/ArchivedCaseDocumentItemConverter.java", "identifier": "ArchivedCaseDocumentItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ArchivedCaseDocumentItemConverter.convert(final Arc...
{ "body": "@Override\n public ArchivedCaseDocumentItem convert(final ArchivedDocument engineItem) {\n final ArchivedCaseDocumentItem item = new ArchivedCaseDocumentItem();\n item.setId(String.valueOf(engineItem.getId()));\n item.setCaseId(String.valueOf(engineItem.getProcessInstanceId()));\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_476
{ "fields": [ { "declarator": "session", "modifier": "@Mock\n private", "original_string": "@Mock\n private APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "applicationAPI", "modifier": "@Mock\n private", "origin...
{ "body": "@Test(expected = APIException.class)\n public void should_throw_APIException_when_engine_throws_CreationException_on_add() throws Exception {\n //given\n given(applicationAPI.createApplicationMenu(any(ApplicationMenuCreator.class))).willThrow(new CreationException(\"\"));\n\n //when...
{ "fields": [ { "declarator": "applicationAPI", "modifier": "private final", "original_string": "private final ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "converter", "modifier": "private final", ...
{ "body": "@Override\n public ApplicationMenuItem add(final ApplicationMenuItem item) {\n try {\n final ApplicationMenu applicationMenu = applicationAPI.createApplicationMenu(converter.toApplicationMenuCreator(item));\n return converter.toApplicationMenuItem(applicationMenu);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_564
{ "fields": [ { "declarator": "journal", "modifier": "@Mock\n private", "original_string": "@Mock\n private TaskDatastore journal;", "type": "TaskDatastore", "var_name": "journal" }, { "declarator": "archives", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void should_return_task_from_the_journal_when_it_belong_to_the_journal() throws Exception {\n final TaskItem task = new TaskItem();\n task.setId(id);\n when(journal.get(id)).thenReturn(task);\n\n final IItem item = taskFinder.find(id);\n\n assertThat(ite...
{ "fields": [ { "declarator": "journal", "modifier": "private final", "original_string": "private final DatastoreHasGet<TaskItem> journal;", "type": "DatastoreHasGet<TaskItem>", "var_name": "journal" }, { "declarator": "archives", "modifier": "private final", ...
{ "body": "public IItem find(final APIID taskId) {\n try {\n return journal.get(taskId);\n } catch (final APIItemNotFoundException e) {\n final Map<String, String> filters = new HashMap<String, String>();\n filters.put(ArchivedActivityItem.ATTRIBUTE_SOURCE_OBJECT_ID, tas...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_134
{ "fields": [ { "declarator": "session = new MockHttpSession()", "modifier": "private final", "original_string": "private final HttpSession session = new MockHttpSession();", "type": "HttpSession", "var_name": "session" }, { "declarator": "response = new MockHttpServlet...
{ "body": "@Test\n public void should_create_token_and_store_it_in_session() throws Exception {\n final String token = tokenGenerator.createOrLoadToken(session);\n assertThat(token).isNotEmpty();\n assertThat(session.getAttribute(TokenGenerator.API_TOKEN)).isEqualTo(token);\n }", "class_m...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(TokenGenerator.class.getName())", "modifier": "protected static final", "original_string": "protected static final Logger LOGGER = Logger.getLogger(TokenGenerator.class.getName());", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "public String createOrLoadToken(final HttpSession session) {\n Object apiTokenFromClient = session.getAttribute(API_TOKEN);\n if (apiTokenFromClient == null) {\n apiTokenFromClient = new APIToken().getToken();\n session.setAttribute(API_TOKEN, apiTokenFromClient);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_837
{ "fields": [ { "declarator": "caller", "modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private", "original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;", "type": "APIServletCall", "var_name": "caller" }, { "declarator": "h...
{ "body": "@Test\n public void add_should_create_an_item_based_on_item_passed_in_parameter() throws Exception {\n given(engine.createDefinition(any(CustomUserInfoDefinitionCreator.class)))\n .willReturn(new EngineCustomUserInfoDefinition(1L));\n ArgumentCaptor<CustomUserInfoDefinitionC...
{ "fields": [ { "declarator": "FIX_ORDER = \"Fix order\"", "modifier": "public static final", "original_string": "public static final String FIX_ORDER = \"Fix order\";", "type": "String", "var_name": "FIX_ORDER" }, { "declarator": "converter = new CustomUserInfoConverte...
{ "body": "public CustomUserInfoDefinitionItem add(CustomUserInfoDefinitionItem definition) {\n return converter.convert(engineClientCreator.create(getEngineSession())\n .createDefinition(new CustomUserInfoDefinitionCreator(\n definition.getName(),\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_1
{ "fields": [ { "declarator": "formWidget", "modifier": "@Mock", "original_string": "@Mock\n ReducedFormWidget formWidget;", "type": "ReducedFormWidget", "var_name": "formWidget" } ], "file": "forms/forms-view/src/test/java/org/bonitasoft/forms/client/view/widget/TableWidg...
{ "body": "@Test\n public void should_get_last_page_index_work_with_an_available_values_list() throws Exception {\n\n final ArrayList<List<ReducedFormFieldAvailableValue>> availableValuesList = new ArrayList<List<ReducedFormFieldAvailableValue>>();\n for (int i = 0; i < 5; i++) {\n availab...
{ "fields": [ { "declarator": "SELECTED_ROW_DEFAULT_STYLE = \"bonita_form_table_selected\"", "modifier": "private static final", "original_string": "private static final String SELECTED_ROW_DEFAULT_STYLE = \"bonita_form_table_selected\";", "type": "String", "var_name": "SELECTED_ROW_...
{ "body": "protected int getLastPageIndex() {\n int lastPageIndex = 0;\n if (maxRows > 0) {\n final int nbOfValues = availableValues.size();\n if (nbOfValues > 0) {\n lastPageIndex = nbOfValues / maxRows - 1;\n if (nbOfValues % maxRows > 0) {\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_421
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/filter/FilterAccessorTest.java", "identifier": "FilterAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWeCanRetrieveMandatoryValue() throws Exception {\n FilterAccessor filterAccess = new FilterAccessor(Collections.singletonMap(\"key\", \"value\"));\n\n String value = filterAccess.getMandatory(\"key\");\n\n assertEquals(\"value\", value);\n }", "class_met...
{ "fields": [ { "declarator": "filters", "modifier": "private", "original_string": "private Map<String, String> filters;", "type": "Map<String, String>", "var_name": "filters" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/filter/FilterAccessor.ja...
{ "body": "public String getMandatory(String filter) {\n ensureFilterValue(filter);\n return getFilters().get(filter);\n }", "class_method_signature": "FilterAccessor.getMandatory(String filter)", "constructor": false, "full_signature": "public String getMandatory(String filter)", "identifier...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_35
{ "fields": [ { "declarator": "session", "modifier": "@Mock\n private", "original_string": "@Mock\n private APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "locale = new Locale(\"en\")", "modifier": "private final", ...
{ "body": "@Test\n public void hasUserAdminProfileShouldReturnFalseForNOTAdminProfile() throws Exception {\n final ProfileAPI profileAPI = mock(ProfileAPI.class);\n final long userId = 488L;\n final Profile profile = mock(Profile.class);\n doReturn(Collections.singletonList(profile)).wh...
{ "fields": [ { "declarator": "FORM_ACTION_CONDITION = \"FormActionCondition_\"", "modifier": "private static final", "original_string": "private static final String FORM_ACTION_CONDITION = \"FormActionCondition_\";", "type": "String", "var_name": "FORM_ACTION_CONDITION" }, {...
{ "body": "protected boolean hasUserAdminProfile(final APISession session, final ProfileAPI profileAPI) {\n List<Profile> profiles;\n int startIndex = 0;\n final int maxResults = 10;\n do {\n profiles = profileAPI.getProfilesForUser(session.getUserId(), startIndex, maxResults, P...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_358
{ "fields": [ { "declarator": "LAYOUT_PAGE_NAME = \"layoutPageName\"", "modifier": "public static final", "original_string": "public static final String LAYOUT_PAGE_NAME = \"layoutPageName\";", "type": "String", "var_name": "LAYOUT_PAGE_NAME" }, { "declarator": "hsReque...
{ "body": "@Test\n public void should_display_layout_page() throws Exception {\n accessAuthorizedPage(\"HumanResources\", \"leavingRequests\");\n\n applicationRouter.route(hsRequest, hsResponse, apiSession, pageRenderer, resourceRenderer, bonitaHomeFolderAccessor);\n\n verify(pageRenderer).dis...
{ "fields": [ { "declarator": "applicationModelFactory", "modifier": "private final", "original_string": "private final ApplicationModelFactory applicationModelFactory;", "type": "ApplicationModelFactory", "var_name": "applicationModelFactory" }, { "declarator": "bonita...
{ "body": "public void route(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse, final APISession session, final PageRenderer pageRenderer,\n final ResourceRenderer resourceRenderer, final BonitaHomeFolderAccessor bonitaHomeFolderAccessor)\n throws CreationException, Bonita...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_708
{ "fields": [ { "declarator": "dataStoreCreator", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationDataStoreCreator dataStoreCreator;", "type": "ApplicationDataStoreCreator", "var_name": "dataStoreCreator" }, { "declarator": "dataStore...
{ "body": "@Test\n public void defineItemDefinition_return_an_instance_of_ApplicationDefinition() throws Exception {\n //when\n final ItemDefinition<ApplicationItem> itemDefinition = apiApplication.defineItemDefinition();\n\n //then\n assertThat(itemDefinition).isExactlyInstanceOf(Appli...
{ "fields": [ { "declarator": "creator", "modifier": "private final", "original_string": "private final ApplicationDataStoreCreator creator;", "type": "ApplicationDataStoreCreator", "var_name": "creator" }, { "declarator": "applicationDataStoreFactory", "modifier"...
{ "body": "@Override\n protected ItemDefinition<ApplicationItem> defineItemDefinition() {\n return ApplicationDefinition.get();\n }", "class_method_signature": "APIApplication.defineItemDefinition()", "constructor": false, "full_signature": "@Override protected ItemDefinition<ApplicationItem> defin...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_790
{ "fields": [ { "declarator": "userDatastore", "modifier": "@Mock\n private", "original_string": "@Mock\n private UserDatastore userDatastore;", "type": "UserDatastore", "var_name": "userDatastore" }, { "declarator": "processDatastore", "modifier": "@Mock\n ...
{ "body": "@Test\n public void fillNumberOfActiveFlowNodesIfActiveCounterExists() {\n // Given\n final APIID id = APIID.makeAPIID(78L);\n final CaseItem item = mock(CaseItem.class);\n doReturn(id).when(item).getId();\n\n final List<String> counters = Arrays.asList(CaseItem.COUNTE...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/cases/APICase.java", "identifier": "APICase", "interfaces": "implements APIHasGet<CaseItem>, APIHasAdd<CaseItem>, APIHasSearch<CaseItem>, APIHasDelete", "methods": [ { "class_method_signature": "APICase.defineItemDe...
{ "body": "@Override\n protected void fillCounters(final CaseItem item, final List<String> counters) {\n fillNumberOfFailedFlowNodesIfFailedCounterExists(item, counters);\n fillNumberOfPendingFlowNodesIfActiveCounterExists(item, counters);\n }", "class_method_signature": "APICase.fillCounters(fi...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_285
{ "fields": [ { "declarator": "customPageAuthorizationsHelper", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CustomPageAuthorizationsHelper customPageAuthorizationsHelper;", "type": "CustomPageAuthorizationsHelper", "var_name": "customPageAuthorizationsHelper" ...
{ "body": "@Test\n public void should_filter_application_page_search_on_application_Token() throws Exception {\n final ArgumentCaptor<SearchOptions> captor = ArgumentCaptor.forClass(SearchOptions.class);\n given(applicationAPI.searchApplications(any(SearchOptions.class)))\n .willReturn...
{ "fields": [ { "declarator": "BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\"", "modifier": "public static final", "original_string": "public static final String BONITA_LABS_PAGE_TOKEN_EXTENSION = \"BonitaLabs\";", "type": "String", "var_name": "BONITA_LABS_PAGE_TOKEN_EXTENSION" ...
{ "body": "public boolean isPageAuthorized(final String appToken, final String pageName) throws BonitaException {\n if (StringUtil.isBlank(appToken)) {\n return isPageAuthorizedInPortal(pageName);\n } else {\n return isPageAuthorizedInApplication(appToken, pageName);\n }\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_42
{ "fields": [ { "declarator": "session", "modifier": "@Mock", "original_string": "@Mock\n APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "themeAPI", "modifier": "@Mock", "original_string": "@Mock\n ThemeAPI themeAP...
{ "body": "@Test\n public void updateThemeFromEngine_should_retrieve_theme_from_Engine_and_compile() throws Exception {\n doReturn(mock(Theme.class)).when(themeAPI).getCurrentTheme(ThemeType.PORTAL);\n doReturn(themeModifier).when(themeArchive).extract(any(File.class));\n doReturn(themeModifie...
{ "fields": [], "file": "forms/forms-server/src/main/java/org/bonitasoft/forms/server/ThemeExtractor.java", "identifier": "ThemeExtractor", "interfaces": "implements Serializable", "methods": [ { "class_method_signature": "ThemeExtractor.ThemeExtractor()", "constructor": true, "full_sign...
{ "body": "void updateThemeFromEngine(ThemeArchive themeArchive, final APISession apiSession, final File portalThemeDirectory, final File timestampFile,\n final long lastUpdateTimestamp, ThemeType themeType) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException, IOException {\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_456
{ "fields": [ { "declarator": "converter = new ApplicationSearchDescriptorConverter()", "modifier": "private final", "original_string": "private final ApplicationSearchDescriptorConverter converter = new ApplicationSearchDescriptorConverter();", "type": "ApplicationSearchDescriptorConverte...
{ "body": "@Test\n public void should_return_ApplicationSearchDescriptor_createdBy_on_convert_attribute_createdBy() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_CREATED_BY);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescr...
{ "fields": [ { "declarator": "mapping", "modifier": "private final", "original_string": "private final Map<String, String> mapping;", "type": "Map<String, String>", "var_name": "mapping" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/...
{ "body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }", "class_method_signature": "ApplicationSearchDescriptorConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String convert(...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_905
{ "fields": [ { "declarator": "toolkitHttpServlet = new ToolkitHttpServlet() {\n @Override\n protected ServletCall defineServletCall(HttpServletRequest req, HttpServletResponse resp) {\n return null;\n }\n }", "modifier": "", "original_string": "ToolkitHttpServ...
{ "body": "@Test\n public void testOutputExceptionPrintProperJson() throws Exception {\n APIException exception = new APIException(\"message\");\n doReturn(writer).when(resp).getWriter();\n\n toolkitHttpServlet.outputException(exception, req, resp, 500);\n\n verify(writer).print(excepti...
{ "fields": [ { "declarator": "serialVersionUID = -8470006030459575773L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -8470006030459575773L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "protected final void outputException(final Throwable e, final HttpServletRequest req, final HttpServletResponse resp, final int httpStatusCode) {\n\n if (httpStatusCode >= 0) {\n resp.setStatus(httpStatusCode);\n }\n resp.setContentType(\"application/json;charset=UTF-8\");\n...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_840
{ "fields": [ { "declarator": "caller", "modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private", "original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;", "type": "APIServletCall", "var_name": "caller" }, { "declarator": "h...
{ "body": "@Test\n public void search_should_retrieve_the_total_number_of_definitions() throws Exception {\n given(engine.countDefinitions()).willReturn(42L);\n\n ItemSearchResult<CustomUserInfoDefinitionItem> result = api.search(0, 2,\n null,\n APICustomUserInfoDefiniti...
{ "fields": [ { "declarator": "FIX_ORDER = \"Fix order\"", "modifier": "public static final", "original_string": "public static final String FIX_ORDER = \"Fix order\";", "type": "String", "var_name": "FIX_ORDER" }, { "declarator": "converter = new CustomUserInfoConverte...
{ "body": "public ItemSearchResult<CustomUserInfoDefinitionItem> search(\n final int page,\n final int resultsByPage,\n final String search,\n final String orders,\n final Map<String, String> filters) {\n\n check(search == null, new _(\"Search terms are no...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_143
{ "fields": [ { "declarator": "SESSION_CSRF_TOKEN = \"csrftoken\"", "modifier": "public static final", "original_string": "public static final String SESSION_CSRF_TOKEN = \"csrftoken\";", "type": "String", "var_name": "SESSION_CSRF_TOKEN" }, { "declarator": "request = n...
{ "body": "@Test\n public void should_set_401_status_when_csrf_request_header_is_wrong() throws Exception {\n request.addHeader(\"X-Bonita-API-Token\", \"notAValidToken\");\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isFalse();\n assertThat(r...
{ "fields": [ { "declarator": "CSRF_TOKEN_PARAM = \"CSRFToken\"", "modifier": "private static final", "original_string": "private static final String CSRF_TOKEN_PARAM = \"CSRFToken\";", "type": "String", "var_name": "CSRF_TOKEN_PARAM" }, { "declarator": "CSRF_TOKEN_HEAD...
{ "body": "@Override\n boolean checkValidCondition(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {\n\n if (isCsrfProtectionEnabled() && !isSafeMethod(httpRequest.getMethod())) {\n String headerFromRequest = getCSRFToken(httpRequest);\n String apiToken = (String) htt...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_513
{ "fields": [ { "declarator": "engineClient", "modifier": "@Mock", "original_string": "@Mock\n ProfileMemberEngineClient engineClient;", "type": "ProfileMemberEngineClient", "var_name": "engineClient" }, { "declarator": "searchProfilesHelper", "modifier": "", ...
{ "body": "@Test(expected = APIFilterMandatoryException.class)\n public void testSearchWithoutMandatoryFiltersThrowError() {\n \n searchProfilesHelper.search(0, 10, null, null, Collections.<String, String> emptyMap());\n }", "class_method_signature": "SearchProfileMembersHelperTest.testSearchWit...
{ "fields": [ { "declarator": "profileMemberClient", "modifier": "private", "original_string": "private ProfileMemberEngineClient profileMemberClient;", "type": "ProfileMemberEngineClient", "var_name": "profileMemberClient" } ], "file": "server/src/main/java/org/bonitasoft/we...
{ "body": "@Override\n public ItemSearchResult<ProfileMemberItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n SearchOptionsCreator options = makeSearchOptions(page, resultsByPage, search, orders, filters);\n SearchResult<ProfileMember> searchResu...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_397
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private FinderFactory factory;", "type": "FinderFactory", "var_name": "factory" }, { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n...
{ "body": "@Test\n public void should_return_ProcessContractResource_for_ProcessContractResourceFinder() {\n final ProcessContractResourceFinder processContractResourceFinder = spy(new ProcessContractResourceFinder());\n doReturn(processAPI).when(processContractResourceFinder).getProcessAPI(any(Reque...
{ "fields": [ { "declarator": "finders", "modifier": "protected", "original_string": "protected Map<Class<? extends ServerResource>, ResourceFinder> finders;", "type": "Map<Class<? extends ServerResource>, ResourceFinder>", "var_name": "finders" }, { "declarator": "reso...
{ "body": "public Finder create(final Class<? extends ServerResource> clazz) {\n final Finder finder = finders.get(clazz);\n if (finder == null) {\n throw new RuntimeException(\"Finder unimplemented for class \" + clazz);\n }\n return finder;\n }", "class_method_signature":...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_682
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "caseEngineClient", "modifier": "private", "origin...
{ "body": "@Test(expected = APIException.class)\n public void we_get_an_exception_if_process_fail_to_start() throws Exception {\n when(processAPI.startProcess(anyLong())).thenThrow(new ProcessExecutionException(\"\"));\n\n caseEngineClient.start(-1L, 1L);\n }", "class_method_signature": "CaseEng...
{ "fields": [ { "declarator": "processAPI", "modifier": "protected", "original_string": "protected ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CaseEngineClient.java", ...
{ "body": "public ProcessInstance start(final long userId, final long processId) {\n return start(userId, processId, null);\n }", "class_method_signature": "CaseEngineClient.start(final long userId, final long processId)", "constructor": false, "full_signature": "public ProcessInstance start(final lon...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_378
{ "fields": [ { "declarator": "hsRequest = new MockHttpServletRequest()", "modifier": "", "original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();", "type": "MockHttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse = ne...
{ "body": "@Test\n public void getResource_should_get_Forbidden_Status_when_unAuthorize() throws Exception {\n hsRequest.setPathInfo(\"/AppToken/htmlexample/content/css/../../../file.css\");\n final File pageDir = new File(\".\");\n given(resourceRenderer.getPathSegments(\"/AppToken/htmlexampl...
{ "fields": [ { "declarator": "RESOURCE_PATH_SEPARATOR = \"/content\"", "modifier": "public static final", "original_string": "public static final String RESOURCE_PATH_SEPARATOR = \"/content\";", "type": "String", "var_name": "RESOURCE_PATH_SEPARATOR" }, { "declarator":...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n final List<String> pathSegments = resourceRenderer.getPathSegments(pathInfo);\n if (isVa...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_728
{ "fields": [ { "declarator": "API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\"", "modifier": "public static final", "original_string": "public static final String API_EXTENSION_POST_MAPPING_KEY = \"apiExtension|POST|myPostResource\";", "type": "String", "var_nam...
{ "body": "@Test\n public void should_not_resolve_class_file_name() throws Exception {\n expectedException.expect(NotFoundException.class);\n expectedException.expectMessage(\"error while getting resource:apiExtension|POST|notResource\");\n\n //given\n final Request request = new Reques...
{ "fields": [ { "declarator": "MAPPING_KEY_SEPARATOR = \"|\"", "modifier": "public static final", "original_string": "public static final String MAPPING_KEY_SEPARATOR = \"|\";", "type": "String", "var_name": "MAPPING_KEY_SEPARATOR" }, { "declarator": "MAPPING_KEY_PREFIX...
{ "body": "public File resolveRestApiControllerFile(PageResourceProviderImpl pageResourceProvider) throws NotFoundException {\n final Properties properties = new Properties();\n\n try (final InputStream resourceAsStream = pageResourceProvider.getResourceAsStream(\"page.properties\");) {\n pro...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_401
{ "fields": [ { "declarator": "finderFactory", "modifier": "@Mock", "original_string": "@Mock\n FinderFactory finderFactory;", "type": "FinderFactory", "var_name": "finderFactory" }, { "declarator": "bonitaJacksonConverter", "modifier": "@Mock", "original...
{ "body": "@Test\n public void should_application_register_bdm_resources() throws Exception {\n //given\n final BonitaRestletApplication bonitaRestletApplication = new BonitaRestletApplication(finderFactory, bonitaJacksonConverter);\n\n //when\n bonitaRestletApplication.buildRouter();\n...
{ "fields": [ { "declarator": "ROUTER_EXTENSION_PREFIX = \"/extension/\"", "modifier": "public static final", "original_string": "public static final String ROUTER_EXTENSION_PREFIX = \"/extension/\";", "type": "String", "var_name": "ROUTER_EXTENSION_PREFIX" }, { "declar...
{ "body": "protected Router buildRouter() {\n final Context context = getContext();\n final Router router = new Router(context);\n // WARNING: if you add a route you need to declare it in org.bonitasoft.web.rest.server.FinderFactory\n\n // GET an activityData:\n router.attach(BPM_AC...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_15
{ "fields": [ { "declarator": "formServiceProviderImpl", "modifier": "@Spy", "original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;", "type": "FormServiceProviderImpl", "var_name": "formServiceProviderImpl" }, { "declarator": "workflowAPI", ...
{ "body": "@Test\n public void should_allow_instance_overview_access_with_custom_form_id_allowed() throws Exception {\n //given\n final String formId = \"formId\";\n doReturn(true).when(formServiceProviderImpl).isCustomFormIdAuthorized(apiSession);\n \n //when\n final bool...
{ "fields": [ { "declarator": "UI_FORM_MODE = \"form\"", "modifier": "private static final", "original_string": "private static final String UI_FORM_MODE = \"form\";", "type": "String", "var_name": "UI_FORM_MODE" }, { "declarator": "LOGGER", "modifier": "protected...
{ "body": "protected boolean isCustomFormIdAuthorized(final APISession session) {\n return DefaultFormsPropertiesFactory.getDefaultFormProperties(session.getTenantId()).isCustomFormIdAuthorized();\n }", "class_method_signature": "FormServiceProviderImpl.isCustomFormIdAuthorized(final APISession session)",...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_544
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private ArchivedCaseDocumentDatastore documentDatastore;", "type": "ArchivedCaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "...
{ "body": "@Test\n public void it_should_throw_an_exception_when_input_is_null() throws DocumentNotFoundException, DeletionException {\n expectedEx.expect(APIException.class);\n expectedEx.expectMessage(\"Error while deleting a document. Document id not specified in the request\");\n\n // When...
{ "fields": [ { "declarator": "constants", "modifier": "protected final", "original_string": "protected final WebBonitaConstantsUtils constants;", "type": "WebBonitaConstantsUtils", "var_name": "constants" }, { "declarator": "processAPI", "modifier": "protected fi...
{ "body": "@Override\n public void delete(final List<APIID> ids) {\n if (ids != null) {\n\n try {\n for (final APIID id : ids) {\n processAPI.deleteContentOfArchivedDocument(id.toLong());\n }\n } catch (final DocumentNotFoundException e)...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_114
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedToSeeTask_should_assign_task() throws Exception {\n when(processAPI.isInvolvedInHumanTaskInstance(1L, 42L)).thenReturn(true);\n when(processAPI.getHumanTaskInstance(42L)).thenReturn(mock(HumanTaskInstance.class));\n\n final boolean isAllowedToSeeTask = p...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedToSeeTask(final APISession apiSession, final long taskInstanceId, final long enforcedUserId,\n final boolean assignTask) throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n try {\n if (processAPI.isInvolvedInHuman...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_817
{ "fields": [ { "declarator": "apiProcess", "modifier": "private", "original_string": "private APIProcess apiProcess;", "type": "APIProcess", "var_name": "apiProcess" }, { "declarator": "caller", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public final void fillCounters_should_fill_number_of_open_cases_when_counter_of_open_cases_is_active() {\n // Given\n final APIID id = APIID.makeAPIID(78L);\n final ProcessItem item = mock(ProcessItem.class);\n doReturn(id).when(item).getId();\n\n final List<St...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/APIProcess.java", "identifier": "APIProcess", "interfaces": "implements\n APIHasAdd<ProcessItem>,\n APIHasUpdate<ProcessItem>,\n APIHasGet<ProcessItem>,\n APIHasSearch<ProcessItem>,\n ...
{ "body": "@Override\n protected void fillCounters(final ProcessItem item, final List<String> counters) {\n fillNumberOfFailedCasesIfFailedCounterExists(item, counters);\n fillNumberOfOpenCasesIfOpenCounterExists(item, counters);\n }", "class_method_signature": "APIProcess.fillCounters(final Pro...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_381
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private FinderFactory factory;", "type": "FinderFactory", "var_name": "factory" }, { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n...
{ "body": "@Test\n public void should_return_BusinessDataResourceFinder_for_BusinessDataResource() throws Exception {\n\n final Finder finder = factory.create(BusinessDataResource.class);\n\n assertThat(finder).isInstanceOf(BusinessDataResourceFinder.class);\n }", "class_method_signature": "Find...
{ "fields": [ { "declarator": "finders", "modifier": "protected", "original_string": "protected Map<Class<? extends ServerResource>, ResourceFinder> finders;", "type": "Map<Class<? extends ServerResource>, ResourceFinder>", "var_name": "finders" }, { "declarator": "reso...
{ "body": "public Finder create(final Class<? extends ServerResource> clazz) {\n final Finder finder = finders.get(clazz);\n if (finder == null) {\n throw new RuntimeException(\"Finder unimplemented for class \" + clazz);\n }\n return finder;\n }", "class_method_signature":...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_694
{ "fields": [ { "declarator": "businessDataModelResource", "modifier": "protected", "original_string": "protected BusinessDataModelResource businessDataModelResource;", "type": "BusinessDataModelResource", "var_name": "businessDataModelResource" }, { "declarator": "tena...
{ "body": "@Test\n public void install_should_throw_APIException_if_InvalidBusinessDataModelException_occurs() throws Exception {\n final File bdmFile = testBDMFile();\n final BusinessDataModelItem item = new BusinessDataModelItem();\n item.setFileUpload(bdmFile.getName());\n doReturn(b...
{ "fields": [ { "declarator": "tenantAdministrationAPI", "modifier": "private final", "original_string": "private final TenantAdministrationAPI tenantAdministrationAPI;", "type": "TenantAdministrationAPI", "var_name": "tenantAdministrationAPI" }, { "declarator": "bonita...
{ "body": "public String getCompleteTempFilePath(final String path) throws IOException {\n return bonitaHomeFolderAccessor.getCompleteTempFilePath(path, apiSession.getTenantId());\n }", "class_method_signature": "BusinessDataModelResource.getCompleteTempFilePath(final String path)", "constructor": false...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_417
{ "fields": [ { "declarator": "engineSession", "modifier": "@Mock\n private", "original_string": "@Mock\n private APISession engineSession;", "type": "APISession", "var_name": "engineSession" }, { "declarator": "commonDatastore", "modifier": "@InjectMocks\n ...
{ "body": "@Test\n public void addLongFilterToSearchBuilder_should_add_less_than_filter_when_is_applicable() {\n // given:\n final String filterName = \"someFilterKey\";\n final String engineAttributeName = \"EngineNumericKey\";\n final Map<String, String> filters = new HashMap<String, ...
{ "fields": [ { "declarator": "engineSession", "modifier": "private", "original_string": "private APISession engineSession;", "type": "APISession", "var_name": "engineSession" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/CommonDatastore.java", ...
{ "body": "protected void addLongFilterToSearchBuilder(final Map<String, String> filters, final SearchOptionsBuilder builder, final String filterName,\n final String engineAttributeName) {\n if (filters != null && filters.containsKey(filterName)) {\n final String filterValue = filters.get...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_801
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "finderFactory", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void should_getTaskIDParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception {\n //given\n doReturn(null).when(taskContextResource).getAttribute(UserTaskContextResource.TASK_ID);\n\n try {\n //when\n taskContextResource.ge...
{ "fields": [ { "declarator": "TASK_ID = \"taskId\"", "modifier": "static final", "original_string": "static final String TASK_ID = \"taskId\";", "type": "String", "var_name": "TASK_ID" }, { "declarator": "processAPI", "modifier": "private final", "original_...
{ "body": "protected long getTaskIdParameter() {\n final String taskId = getAttribute(TASK_ID);\n if (taskId == null) {\n throw new APIException(\"Attribute '\" + TASK_ID + \"' is mandatory in order to get the task context\");\n }\n return Long.parseLong(taskId);\n }", "cla...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_102
{ "fields": [ { "declarator": "accessor", "modifier": "@Mock\n private", "original_string": "@Mock\n private HtmlAccessor accessor;", "type": "HtmlAccessor", "var_name": "accessor" } ], "file": "portal/src/test/java/org/bonitasoft/web/toolkit/client/ui/html/VariableUtil...
{ "body": "@Test\n public void testWeCanReplaceASpecificVariable() throws Exception {\n doReturn(\"<p>This is %variable1% for variable1 but not for variable2</p>\")\n .when(accessor)\n .getInnerHTML();\n\n VariableUtils.inject(accessor, \"variable1\", SafeHtmlUtils.fromT...
{ "fields": [], "file": "portal/src/main/java/org/bonitasoft/web/toolkit/client/ui/html/VariableUtils.java", "identifier": "VariableUtils", "interfaces": "", "methods": [ { "class_method_signature": "VariableUtils.inject(HtmlAccessor accessor, String name, SafeHtml value)", "constructor": fals...
{ "body": "public static void inject(HtmlAccessor accessor, String name, SafeHtml value) {\n accessor.setInnerHTML(replaceAll(accessor.getInnerHTML(), name, value));\n }", "class_method_signature": "VariableUtils.inject(HtmlAccessor accessor, String name, SafeHtml value)", "constructor": false, "full_...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }