id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
11337147_552
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private CaseDocumentDatastore documentDatastore;", "type": "CaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "modifier": "@Moc...
{ "body": "@Test(expected = APIException.class)\n public void it_throws_an_exception_adding_a_document_with_invalid_inputs() {\n // Given\n mockedDocumentItem.setAttribute(CaseDocumentItem.ATTRIBUTE_CASE_ID, -1);\n mockedDocumentItem.setAttribute(CaseDocumentItem.ATTRIBUTE_NAME, \"\");\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 public CaseDocumentItem add(final CaseDocumentItem item) {\n\n long caseId = -1;\n int index = -1;\n String documentDescription = \"\";\n DocumentValue documentValue = null;\n\n try {\n if (item.getAttributeValue(CaseDocumentItem.ATTRIBUTE_CASE_I...
{ "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_786
{ "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 final void fillDeploys_should_do_nothing_when_deploy_of_started_by_substitute_is_not_active() {\n // Given\n final CaseItem item = mock(CaseItem.class);\n final List<String> deploys = new ArrayList<String>();\n\n // When\n apiCase.fillDeploys(item, deplo...
{ "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 fillDeploys(final CaseItem item, final List<String> deploys) {\n fillStartedBy(item, deploys);\n fillStartedBySubstitute(item, deploys);\n fillProcess(item, deploys);\n }", "class_method_signature": "APICase.fillDeploys(final CaseItem item, final List...
{ "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_339
{ "fields": [ { "declarator": "collector = new ChildrenMenuCollector(1L)", "modifier": "", "original_string": "ChildrenMenuCollector collector = new ChildrenMenuCollector(1L);", "type": "ChildrenMenuCollector", "var_name": "collector" }, { "declarator": "menu = new Appl...
{ "body": "@Test\n public void should_not_be_collectible_when_menu_parentId_is_null() {\n menu.setParentId(null);\n\n assertThat(collector.isCollectible(menu)).isFalse();\n }", "class_method_signature": "ChildrenMenuCollectorTest.should_not_be_collectible_when_menu_parentId_is_null()", "constr...
{ "fields": [ { "declarator": "parentId", "modifier": "private final", "original_string": "private final Long parentId;", "type": "Long", "var_name": "parentId" } ], "file": "server/src/main/java/org/bonitasoft/livingapps/menu/ChildrenMenuCollector.java", "identifier": "Chi...
{ "body": "@Override\n public boolean isCollectible(final ApplicationMenu menu) {\n return parentId.equals(menu.getParentId());\n }", "class_method_signature": "ChildrenMenuCollector.isCollectible(final ApplicationMenu menu)", "constructor": false, "full_signature": "@Override public boolean isColl...
{ "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_293
{ "fields": [ { "declarator": "PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\"", "modifier": "public static final", "original_string": "public static final String PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\";", "type": "String", "var_name"...
{ "body": "@Test\n public void should_get_Custom_Page_permissions_to_CompoundPermissions_with_empty_list() throws Exception {\n // Given\n final String fileContent = \"name=customPage1\\n\" +\n \"resources=[]\";\n\n final File pagePropertiesFile = File.createTempFile(PAGE_PROPER...
{ "fields": [ { "declarator": "PAGE_PROPERTIES = \"page.properties\"", "modifier": "private static final", "original_string": "private static final String PAGE_PROPERTIES = \"page.properties\";", "type": "String", "var_name": "PAGE_PROPERTIES" }, { "declarator": "GET_SY...
{ "body": "public Set<String> getCustomPagePermissions(final Properties pageProperties,\n final ResourcesPermissionsMapping resourcesPermissionsMapping,\n final boolean alsoReturnResourcesNotFound) {\n final PropertiesWithSet pagePropertiesWithSet = new PropertiesWithSet(pageProperties);\...
{ "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_769
{ "fields": [ { "declarator": "attributeChecker", "modifier": "private", "original_string": "private APICaseVariableAttributeChecker attributeChecker;", "type": "APICaseVariableAttributeChecker", "var_name": "attributeChecker" } ], "file": "server/src/test/java/org/bonitasoft...
{ "body": "@Test(expected = APIException.class)\n public void checkSearchFiltersCheckForCaseIdFilters() throws Exception {\n Map<String, String> filters = buildSuitableSearchFilters();\n filters.remove(CaseVariableItem.ATTRIBUTE_CASE_ID);\n\n attributeChecker.checkSearchFilters(filters);\n ...
{ "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 checkSearchFilters(Map<String, String> filters) {\n if (filters == null || !filters.containsKey(CaseVariableItem.ATTRIBUTE_CASE_ID)) {\n throw new APIException(format(\"Filter '%s' must be specified\", CaseVariableItem.ATTRIBUTE_CASE_ID));\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_440
{ "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_throw_APIException_on_search_when_engine_throws_exception() throws Exception {\n //given\n given(applicationAPI.searchApplications(any(SearchOptions.class))).willThrow(new SearchException(new Exception()));\n\n //when\n ...
{ "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 ItemSearchResult<ApplicationItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n // Build search\n final SearchOptionsCreator creator = makeSearchOptionCreator(page, resultsByP...
{ "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_54
{ "fields": [ { "declarator": "testDirectory = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder testDirectory = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "testDirectory" }, { "declarator...
{ "body": "@Test\n public void should_compile_given_file_into_theme_directory() throws Exception {\n final ThemeArchive themeArchive = new ThemeArchive(\n createStyleFiles(\"style1.less\", \"style2.less\", \"style3.css\"));\n\n themeArchive.extract(themeDirectory).compile(\n ...
{ "fields": [ { "declarator": "zippedTheme", "modifier": "private", "original_string": "private byte[] zippedTheme;", "type": "byte[]", "var_name": "zippedTheme" } ], "file": "common/src/main/java/org/bonitasoft/console/common/server/themes/ThemeArchive.java", "identifier":...
{ "body": "public ThemeModifier extract(File themeDirectory) throws IOException {\n checkZippedThemeIsSet();\n FileUtils.deleteDirectory(themeDirectory);\n try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(zippedTheme)) {\n UnzipUtil.unzip(byteArrayInputStream, ...
{ "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_505
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntrySearchDescriptorConverterTest.java", "identifier": "ProfileEntrySearchDescriptorConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWeCanConvertTheProfileEntryName() throws Exception {\n String descriptor = new ProfileEntrySearchDescriptorConverter()\n .convert(ProfileEntryItem.ATTRIBUTE_NAME);\n\n assertEquals(ProfileEntrySearchDescriptor.NAME, descriptor);\n }", "class_meth...
{ "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_155
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test\n public void should_checkValidCondition_check_session_is_platform_with_API_toolkit() throws ServletException {\n doReturn(\"APIToolkit/platform/plop\").when(request).getRequestURI();\n doReturn(mock(PlatformSession.class)).when(httpSession).getAttribute(RestAPIAuthorizationFilter.PL...
{ "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_856
{ "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(expected = APIException.class)\n public void should_fail_when_passing_wrong_filter_to_the_search() {\n api.search(0, 2, null, \"Fix order\", Collections.singletonMap(\"foo\", \"bar\")).getResults();\n }", "class_method_signature": "APICustomUserInfoUserTest.should_fail_when_passing_wro...
{ "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": "engineClientCreator", "modifier"...
{ "body": "@Override\n public ItemSearchResult<CustomUserInfoItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n check(containsOnly(FILTER_USER_ID, filters), new _(\"The only mandatory filter is %name%\", new Arg(\"name\", FILTER_USER_ID)));\n chec...
{ "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_342
{ "fields": [ { "declarator": "applicationApi", "modifier": "@Mock", "original_string": "@Mock\n ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" }, { "declarator": "pageApi", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void should_authorize_a_user_with_the_configured_application_profile() throws Exception {\n final ProfileImpl profile1 = new ProfileImpl(\"user\");\n profile1.setId(1L);\n final ProfileImpl profile2 = new ProfileImpl(\"administrator\");\n profile1.setId(2L);\n ...
{ "fields": [ { "declarator": "profileApi", "modifier": "private final", "original_string": "private final ProfileAPI profileApi;", "type": "ProfileAPI", "var_name": "profileApi" }, { "declarator": "applicationApi", "modifier": "private final", "original_str...
{ "body": "public boolean authorize(final APISession session) {\n for (final Profile userProfile : getUserProfiles(session)) {\n if (userProfile.getId() == application.getProfileId()) {\n return true;\n }\n }\n return false;\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_712
{ "fields": [ { "declarator": "fakeService", "modifier": "@Mock\n private", "original_string": "@Mock\n private FakeService fakeService;", "type": "FakeService", "var_name": "fakeService" }, { "declarator": "headers = new Series<>(Header.class)", "modifier":...
{ "body": "@Test\n public void parseFilterShoulReturnNullIfListIsNull() throws Exception {\n assertThat(new CommonResource().parseFilters(null)).isNull();\n }", "class_method_signature": "CommonResourceTest.parseFilterShoulReturnNullIfListIsNull()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "sessionSingleton = null", "modifier": "private", "original_string": "private APISession sessionSingleton = null;", "type": "APISession", "var_name": "sessionSingleton" }, { "declarator": "LOGGER = Logger.getLogger(CommonResource.class.getN...
{ "body": "protected Map<String, String> parseFilters(final List<String> parameters) {\n if (parameters == null) {\n return null;\n }\n final Map<String, String> results = new HashMap<>();\n for (final String parameter : parameters) {\n final String[] split = paramete...
{ "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_207
{ "fields": [ { "declarator": "ICON_ID = 1238970432L", "modifier": "private static final", "original_string": "private static final long ICON_ID = 1238970432L;", "type": "long", "var_name": "ICON_ID" }, { "declarator": "iconServlet", "modifier": "@Spy\n private...
{ "body": "@Test\n public void should_status_be_BAD_REQUEST_when_id_is_not_a_long_in_url() throws Exception {\n httpServletRequest.setPathInfo(\"notALong\");\n\n iconServlet.doGet(httpServletRequest, httpServletResponse);\n\n assertThat(httpServletResponse.getStatus()).isEqualTo(HttpServletRes...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGER = Logger.getLogger(IconServlet.cla...
{ "body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {\n String iconIdPath = request.getPathInfo();\n if (iconIdPath == null || iconIdPath.isEmpty()) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUE...
{ "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_657
{ "fields": [ { "declarator": "BUNCH_SIZE = 10", "modifier": "private static", "original_string": "private static Integer BUNCH_SIZE = 10;", "type": "Integer", "var_name": "BUNCH_SIZE" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n public void getProcessDataDefinitions_get_all_process_data_definition() throws Exception {\n final long expectedProcessId = 1L;\n\n processEngineClient.getProcessDataDefinitions(expectedProcessId);\n\n verify(processAPI).getProcessDataDefinitions(expectedProcessId, 0, Intege...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(ProcessEngineClient.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(ProcessEngineClient.class.getName());", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public List<DataDefinition> getProcessDataDefinitions(final long processId) {\n try {\n return processAPI.getProcessDataDefinitions(processId, 0, Integer.MAX_VALUE);\n } catch (final ProcessDefinitionNotFoundException e) {\n throw new APIException(new _(\"Unable to get 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_591
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/converter/StringValueConverterTest.java", "identifier": "StringValueConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStringConvertion() throws Exception {\n String value = new StringValueConverter().convert(\"cba\");\n\n assertEquals(\"cba\", value);\n }", "class_method_signature": "StringValueConverterTest.testStringConvertion()", "constructor": false, "full_signature": ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/StringValueConverter.java", "identifier": "StringValueConverter", "interfaces": "implements ValueConverter<String>", "methods": [ { "class_method_signature": "StringValueConverter.convert(String value)",...
{ "body": "@Override\n public String convert(String value) {\n return value;\n }", "class_method_signature": "StringValueConverter.convert(String value)", "constructor": false, "full_signature": "@Override public String convert(String value)", "identifier": "convert", "invocations": [], "modi...
{ "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_745
{ "fields": [ { "declarator": "dataStoreFactory", "modifier": "@Mock\n private", "original_string": "@Mock\n private APIApplicationDataStoreFactory dataStoreFactory;", "type": "APIApplicationDataStoreFactory", "var_name": "dataStoreFactory" }, { "declarator": "app...
{ "body": "@Test\n public void defineItemDefinition_return_an_instance_of_ApplicationDefinition() throws Exception {\n //when\n final ItemDefinition<ApplicationPageItem> itemDefinition = apiApplicationPage.defineItemDefinition();\n\n //then\n assertThat(itemDefinition).isExactlyInstance...
{ "fields": [ { "declarator": "factory", "modifier": "private final", "original_string": "private final APIApplicationDataStoreFactory factory;", "type": "APIApplicationDataStoreFactory", "var_name": "factory" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/...
{ "body": "@Override\n protected ItemDefinition<ApplicationPageItem> defineItemDefinition() {\n return ApplicationPageDefinition.get();\n }", "class_method_signature": "APIApplicationPage.defineItemDefinition()", "constructor": false, "full_signature": "@Override protected ItemDefinition<Applicatio...
{ "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_315
{ "fields": [ { "declarator": "pageMappingService", "modifier": "@Spy", "original_string": "@Spy\n PageMappingService pageMappingService;", "type": "PageMappingService", "var_name": "pageMappingService" }, { "declarator": "pageAPI", "modifier": "@Mock", "...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void getPage() throws Exception {\n final PageURL pageURL = mock(PageURL.class);\n when(pageURL.getUrl()).thenReturn(\"/externalURL\");\n when(pageURL.getPageId()).thenReturn(null);\n ArgumentCaptor<Map> contextCaptor = Arg...
{ "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" } ], "file": "server/src/main/jav...
{ "body": "public PageReference getPage(final HttpServletRequest request, final APISession apiSession, final String mappingKey, final Locale locale,\n final boolean executeAuthorizationRules) throws BonitaException {\n final Map<String, Serializable> context = new HashMap<>();\n //clone the r...
{ "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_600
{ "fields": [ { "declarator": "TENANT_ID = 123532L", "modifier": "private static final", "original_string": "private static final long TENANT_ID = 123532L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "processAPI", "modifier": "@Mock\n private",...
{ "body": "@Test\n public void testSearchUsersWhoCanPerformTask_with_should_return_nothing() throws Exception {\n when(processAPI.searchUsersWhoCanExecutePendingHumanTask(eq(0L), any(SearchOptions.class))).thenReturn(mock(SearchResult.class));\n ItemSearchResult<UserItem> results = datastore.searchUs...
{ "fields": [ { "declarator": "engineClientFactory", "modifier": "protected", "original_string": "protected EngineClientFactory engineClientFactory;", "type": "EngineClientFactory", "var_name": "engineClientFactory" }, { "declarator": "userItemConverter", "modifie...
{ "body": "protected ItemSearchResult<UserItem> searchUsersWhoCanPerformTask(final String taskId, final int page, final int resultsByPage, final String search,\n final Map<String, String> filters, final String orders) {\n\n SearchResult<User> engineSearchResults;\n try {\n SearchOp...
{ "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_250
{ "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 convertToType_should_convert_a_LongString_to_a_LocalDate() {\n ContractTypeConverter converter = new ContractTypeConverter(ISO_8601_DATE_PATTERNS);\n\n final Object localDate = converter.convertToType(Type.LOCALDATE, \"1987-10-11T19:32\");\n\n assertThat(localDat...
{ "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": "Object convertToType(final Type type, final Serializable parameterValue) {\n final Class<? extends Serializable> clazz = getClassFromType(type);\n Serializable preprocessedParameterValue = preprocessInputs(type, parameterValue);\n return convertToType(clazz, preprocessedParameterValue)...
{ "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_483
{ "fields": [ { "declarator": "tenantAdminDatastore = null", "modifier": "private", "original_string": "private TenantAdminDatastore tenantAdminDatastore = null;", "type": "TenantAdminDatastore", "var_name": "tenantAdminDatastore" }, { "declarator": "tenantAdministratio...
{ "body": "@Test\n public void testUpdateAlreadyInMaintenance() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(true);\n final APIID apiid = APIID.makeAPIID(1L);\n\n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.update(apiid,\n mapOf(Tenan...
{ "fields": [ { "declarator": "apiSession", "modifier": "protected", "original_string": "protected APISession apiSession;", "type": "APISession", "var_name": "apiSession" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/system/TenantAdminDatastore.j...
{ "body": "@Override\n public TenantAdminItem update(final APIID unusedId, final Map<String, String> attributes) {\n final TenantAdminItem tenantAdminItem = new TenantAdminItem();\n try {\n final boolean doPause = Boolean.parseBoolean(attributes.get(TenantAdminItem.ATTRIBUTE_IS_PAUSED));\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_179
{ "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 testCreateRedirectUrlWithDefaultRedirectAndNonDefaultTenant() throws Exception {\n doReturn(null).when(requestAccessor).getRedirectUrl();\n \n String redirectURL = logoutServlet.createRedirectUrl(requestAccessor, 3L);\n \n assertThat(redirectURL).is...
{ "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 createRedirectUrl(final HttpServletRequestAccessor request, final long tenantId) throws ServletException {\n final String redirectUrlFromRequest = request.getRedirectUrl();\n String redirectUrl = redirectUrlFromRequest != null ? redirectUrlFromRequest : getDefaultRedirectUrl(...
{ "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_97
{ "fields": [], "file": "portal/src/test/java/org/bonitasoft/console/client/angular/AngularParameterCleanerTest.java", "identifier": "AngularParameterCleanerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void appendTabFromTokensToUrlWithArchivedTabTokenShouldBeAppendToUrl() throws Exception {\n assertEquals(\"\", new AngularParameterCleaner(\"cases\", \"cases_tab=archived\").getHashWithoutAngularParameters());\n assertEquals(\"\", new AngularParameterCleaner(\"cases\", \"&ca...
{ "fields": [ { "declarator": "hash", "modifier": "private final", "original_string": "private final String hash;", "type": "String", "var_name": "hash" }, { "declarator": "token", "modifier": "private final", "original_string": "private final String token;"...
{ "body": "public String getHashWithoutAngularParameters() {\n return hash\n .replaceAll(\"&?\" + token + \"_id=[^&\\\\?#]*\", \"\")\n .replaceAll(\"&?\" + token + \"_tab=[^&\\\\?#]*\", \"\");\n }", "class_method_signature": "AngularParameterCleaner.getHashWithoutAngularParam...
{ "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_529
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/utils/SortsTest.java", "identifier": "SortsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMultipleSortListing() throws Exception {\n String attribute1Order = \"attribute1 \" + Order.ASC;\n String attribute2Order = \"attribute2 \" + Order.DESC;\n Sorts sorts = new Sorts(attribute1Order + \",\" + attribute2Order);\n\n List<Sort> sortList = so...
{ "fields": [ { "declarator": "sorts", "modifier": "private", "original_string": "private List<Sort> sorts;", "type": "List<Sort>", "var_name": "sorts" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/utils/Sorts.java", "identifier": "Sorts", "i...
{ "body": "public List<Sort> asList() {\n return sorts;\n }", "class_method_signature": "Sorts.asList()", "constructor": false, "full_signature": "public List<Sort> asList()", "identifier": "asList", "invocations": [], "modifiers": "public", "parameters": "()", "return": "List<Sort>", "sig...
{ "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_78
{ "fields": [], "file": "common/src/test/java/org/bonitasoft/console/common/server/preferences/properties/ResourcesPermissionsMappingTest.java", "identifier": "ResourcesPermissionsMappingTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetResourcePermission() throws Exception {\n //given\n final String fileContent = \"GET|bpm/process [Process visualization, Process categories, Process actor mapping visualization, Connector visualization]\\n\"\n +\n \"POST|bpm/process ...
{ "fields": [ { "declarator": "API_METHOD_SEPARATOR = \"|\"", "modifier": "public static final", "original_string": "public static final String API_METHOD_SEPARATOR = \"|\";", "type": "String", "var_name": "API_METHOD_SEPARATOR" }, { "declarator": "WILDCARD = \"*\"", ...
{ "body": "public Set<String> getResourcePermissions(final String method, final String apiName, final String resourceName, final List<String> resourceQualifiers) {\n final String key = buildResourceKey(method, apiName, resourceName, resourceQualifiers);\n return getPropertyAsSet(key);\n }", "class_...
{ "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_196
{ "fields": [ { "declarator": "JOHN = \"john\"", "modifier": "public static final", "original_string": "public static final String JOHN = \"john\";", "type": "String", "var_name": "JOHN" }, { "declarator": "DOE = \"doe\"", "modifier": "public static final", ...
{ "body": "@Test\n public void should_send_error_403_on_wrong_credential() throws Exception {\n //given\n doThrow(new InvalidPlatformCredentialsException(\"\")).when(platformLoginAPI).login(JOHN, DOE);\n //when\n platformLoginServlet.doPost(httpServletRequest, httpServletResponse);\n ...
{ "fields": [ { "declarator": "USERNAME_PARAM = \"username\"", "modifier": "protected static final", "original_string": "protected static final String USERNAME_PARAM = \"username\";", "type": "String", "var_name": "USERNAME_PARAM" }, { "declarator": "PASSWORD_PARAM = \"...
{ "body": "@Override\n protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n boolean redirectAfterLogin = true;\n final String redirectAfterLoginStr = request.getParameter(AuthenticationManager.REDIRECT_AFTER_LOGIN_PARAM_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_895
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/StringConverterTest.java", "identifier": "StringConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void stringConverterIsDummy() throws Exception {\n\n String converted = new StringConverter().convert(\"any string\");\n\n assertEquals(\"any string\", converted);\n }", "class_method_signature": "StringConverterTest.stringConverterIsDummy()", "constructor": false, ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/StringConverter.java", "identifier": "StringConverter", "interfaces": "implements Converter<String>", "methods": [ { "class_method_signature": "StringConverter.convert(String convert)", ...
{ "body": "@Override\n public String convert(String convert) {\n return convert;\n }", "class_method_signature": "StringConverter.convert(String convert)", "constructor": false, "full_signature": "@Override public String convert(String convert)", "identifier": "convert", "invocations": [], "m...
{ "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_303
{ "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_redirect_to_valide_url_on_missing_slash() throws Exception {\n hsRequest.setRequestURI(\"/bonita/portal/custom-page/custompage_htmlexample?anyparam=paramvalue\");\n hsRequest.setPathInfo(\"/custompage_htmlexample\");\n\n servlet.doGet(hsRequest, hsResponse...
{ "fields": [ { "declarator": "APP_TOKEN_PARAM = \"appToken\"", "modifier": "public static final", "original_string": "public static final String APP_TOKEN_PARAM = \"appToken\";", "type": "String", "var_name": "APP_TOKEN_PARAM" }, { "declarator": "serialVersionUID = -54...
{ "body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n /*\n * Check if requested URL is missing last slash, like \"custom-page/page-name\".\n * If missing, redirect to \"custom-page/page-name/...
{ "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_753
{ "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\n public void sendMessage_should_throw_exception_when_message_content_value_is_missing() throws Exception {\n // given:\n final BPMMessage bpmMessage = new BPMMessage();\n bpmMessage.setMessageName(\"msg\");\n bpmMessage.setTargetProcess(\"myProcess\");\n bpmMess...
{ "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_246
{ "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 convertToType_should_convert_to_OffsetDateTime_every_input_format_string() {\n ContractTypeConverter converter = new ContractTypeConverter(ISO_8601_DATE_PATTERNS);\n Map<String, Object> conversionMap = new HashMap<>();\n conversionMap.put(\"1987-12-12T10:00:00Z\"...
{ "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": "Object convertToType(final Type type, final Serializable parameterValue) {\n final Class<? extends Serializable> clazz = getClassFromType(type);\n Serializable preprocessedParameterValue = preprocessInputs(type, parameterValue);\n return convertToType(clazz, preprocessedParameterValue)...
{ "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_616
{ "fields": [ { "declarator": "customPageContentValidator", "modifier": "private", "original_string": "private CustomPageContentValidator customPageContentValidator;", "type": "CustomPageContentValidator", "var_name": "customPageContentValidator" }, { "declarator": "exp...
{ "body": "@Test\n public void should_throw_exception_when_index_not_found() throws Exception {\n final File invalidFormPage = new File(getClass().getResource(\"/invalidFormPage\").toURI());\n \n expectedException.expect(InvalidPageZipContentException.class);\n expectedException.expectM...
{ "fields": [ { "declarator": "INDEX_GROOVY = \"Index.groovy\"", "modifier": "private static final", "original_string": "private static final String INDEX_GROOVY = \"Index.groovy\";", "type": "String", "var_name": "INDEX_GROOVY" }, { "declarator": "INDEX_HTML = \"index....
{ "body": "public void validate(File pageFolder) throws InvalidPageZipContentException {\n final File[] rootFiles = pageFolder.listFiles();\n if (rootFiles == null) {\n throw new InvalidPageZipContentException(\n \"Content not found.\");\n }\n Properties pageP...
{ "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_81
{ "fields": [ { "declarator": "TENANT_ID = 12L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 12L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "COMPOUND_PERMISSIONS_MAPPING_FILE = \"compound.properties\"", ...
{ "body": "@Test\n public void should_getProperty_return_the_right_compound_permissions() throws Exception {\n\n final ConfigurationFile tenantProperties = new ConfigurationFile(COMPOUND_PERMISSIONS_MAPPING_FILE, TENANT_ID);\n\n final String compoundValue = tenantProperties.getProperty(\"taskListingP...
{ "fields": [ { "declarator": "propertiesFilename", "modifier": "private final", "original_string": "private final String propertiesFilename;", "type": "String", "var_name": "propertiesFilename" }, { "declarator": "tenantId", "modifier": "private final", "or...
{ "body": "public String getProperty(final String propertyName) {\n return getPropertiesOfScope().getProperty(propertyName);\n }", "class_method_signature": "ConfigurationFile.getProperty(final String propertyName)", "constructor": false, "full_signature": "public String getProperty(final String prope...
{ "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_495
{ "fields": [ { "declarator": "profileAPI", "modifier": "@Mock", "original_string": "@Mock\n ProfileAPI profileAPI;", "type": "ProfileAPI", "var_name": "profileAPI" }, { "declarator": "searchProfilesHelper", "modifier": "", "original_string": "SearchProfi...
{ "body": "@Test\n public void testWeCanListUserProfilesWithNavigation() throws Exception {\n final SearchResultImpl<Profile> aKnownSearchResult = aKnownSearchResult();\n final List<ProfileItem> expectedProfiles = new ProfileItemConverter().convert(aKnownSearchResult.getResult());\n when(profi...
{ "fields": [ { "declarator": "profileClient", "modifier": "private", "original_string": "private ProfileEngineClient profileClient;", "type": "ProfileEngineClient", "var_name": "profileClient" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profil...
{ "body": "@Override\n public ItemSearchResult<ProfileItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n if (isFilteredBy(filters, ProfileItem.FILTER_USER_ID)) {\n return searchProfilesForUser(page, filters);\n }\n return searchP...
{ "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_883
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private IntegerConverter converter;", "type": "IntegerConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/In...
{ "body": "@Test\n public void emptyIsConvertedToNull() throws Exception {\n\n Integer converted = converter.convert(\"\");\n\n assertNull(converted);\n }", "class_method_signature": "IntegerConverterTest.emptyIsConvertedToNull()", "constructor": false, "full_signature": "@Test public void e...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/IntegerConverter.java", "identifier": "IntegerConverter", "interfaces": "implements Converter<Integer>", "methods": [ { "class_method_signature": "IntegerConverter.convert(String toBeConverte...
{ "body": "@Override\n public Integer convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Integer.parseInt(toBeConverted);\n } catch (NumberFormatException 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_180
{ "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 testCreateRedirectUrl() throws Exception {\n doReturn(\"redirectURL\").when(requestAccessor).getRedirectUrl();\n \n String redirectURL = logoutServlet.createRedirectUrl(requestAccessor, 1L);\n \n assertThat(redirectURL).isEqualTo(\"redirectURL\");\n...
{ "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 createRedirectUrl(final HttpServletRequestAccessor request, final long tenantId) throws ServletException {\n final String redirectUrlFromRequest = request.getRedirectUrl();\n String redirectUrl = redirectUrlFromRequest != null ? redirectUrlFromRequest : getDefaultRedirectUrl(...
{ "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_704
{ "fields": [ { "declarator": "formMapping", "modifier": "@Mock", "original_string": "@Mock\n FormMapping formMapping;", "type": "FormMapping", "var_name": "formMapping" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/form/FormMappingItemTest.java", ...
{ "body": "@Test\n public void it_should_handle_a_null_pageId() {\n //given\n when(formMapping.getPageId()).thenReturn(null);\n\n //when\n FormMappingItem formMappingItem = new FormMappingItem(formMapping);\n\n assertThat(formMappingItem.getPageId()).isEqualTo(null);\n }", "...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "processDefinitionId", "modifier": "private", "original_string": "private String processDefinitionId;", ...
{ "body": "public String getPageId() {\n return pageId;\n }", "class_method_signature": "FormMappingItem.getPageId()", "constructor": false, "full_signature": "public String getPageId()", "identifier": "getPageId", "invocations": [], "modifiers": "public", "parameters": "()", "return": "Stri...
{ "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_354
{ "fields": [ { "declarator": "applicationApi", "modifier": "@Mock(answer = Answers.RETURNS_MOCKS)", "original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" }, { "declarator":...
{ "body": "@Test\n public void should_filter_search_using_given_name() throws Exception {\n final ArgumentCaptor<SearchOptions> captor = ArgumentCaptor.forClass(SearchOptions.class);\n given(applicationApi.searchApplications(any(SearchOptions.class))).willReturn(\n new SearchResultImpl...
{ "fields": [ { "declarator": "applicationApi", "modifier": "private final", "original_string": "private final ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" }, { "declarator": "customPageApi", "modifier": "private final", ...
{ "body": "public ApplicationModel createApplicationModel(final String name) throws CreationException {\n\n try {\n final SearchResult<Application> result = applicationApi.searchApplications(\n new SearchOptionsBuilder(0, 1)\n .filter(ApplicationSearchDescriptor...
{ "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_641
{ "fields": [ { "declarator": "profileAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProfileAPI profileAPI;", "type": "ProfileAPI", "var_name": "profileAPI" }, { "declarator": "engineClient", "modifier": "private", "original_s...
{ "body": "@Test(expected = APIItemNotFoundException.class)\n public void getProfileEntryItem_call_engine_and_if_profile_entry_not_found_raises_ProfileEntryException() throws APIItemNotFoundException, ProfileEntryNotFoundException {\n \n doThrow(new APIItemNotFoundException(\"profile entry not...
{ "fields": [ { "declarator": "profileApi", "modifier": "private final", "original_string": "private final ProfileAPI profileApi;", "type": "ProfileAPI", "var_name": "profileApi" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/ProfileEntryEngine...
{ "body": "public ProfileEntry getProfileEntry(final Long id) {\n try {\n return profileApi.getProfileEntry(id);\n } catch (final InvalidSessionException e) {\n throw new APIException(e);\n } catch (final ProfileEntryNotFoundException e) {\n throw new APIItemNotFo...
{ "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_211
{ "fields": [ { "declarator": "tempFolder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "tempFolder" }, { "declarator": "fileU...
{ "body": "@Test\n public void should_throw_fileTooBigException_when_file_is_bigger_in_than_conf_file() throws Exception {\n final ServletFileUpload serviceFileUpload = mock(ServletFileUpload.class);\n\n when(consoleProperties.getMaxSize()).thenReturn(1L); // 1Mb\n fileUploadServlet.setUploadS...
{ "fields": [ { "declarator": "serialVersionUID = 58370675886169565L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 58370675886169565L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "server/src/main/java/...
{ "body": "@Override\n protected void setUploadSizeMax(final ServletFileUpload serviceFileUpload, final HttpServletRequest request) {\n serviceFileUpload.setFileSizeMax(getConsoleProperties(getAPISession(request).getTenantId()).getMaxSize() * MEGABYTE);\n }", "class_method_signature": "TenantFileUpload...
{ "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_138
{ "fields": [ { "declarator": "request", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequestAccessor request;", "type": "HttpServletRequestAccessor", "var_name": "request" }, { "declarator": "tenantAccessor", "modifier": "@M...
{ "body": "@Test\n public void testIfRuleAuthorizeAlreadyLoggedUser() throws Exception {\n doReturn(apiSession).when(request).getApiSession();\n // ensure we won't recreate user session\n doReturn(\"\").when(httpSession).getAttribute(SessionUtil.USER_SESSION_PARAM_KEY);\n\n final boolea...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/console/common/server/login/filter/AlreadyLoggedInRule.java", "identifier": "AlreadyLoggedInRule", "interfaces": "", "methods": [ { "class_method_signature": "AlreadyLoggedInRule.doAuthorize(final HttpServletRequestAccessor request, HttpSe...
{ "body": "@Override\n public boolean doAuthorize(final HttpServletRequestAccessor request, HttpServletResponse response, final TenantIdAccessor tenantIdAccessor) throws ServletException {\n if (isUserAlreadyLoggedIn(request, tenantIdAccessor)) {\n ensureUserSession(request.asHttpServletRequest()...
{ "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_568
{ "fields": [ { "declarator": "datastore", "modifier": "", "original_string": "AbstractFlowNodeDatastore<FlowNodeItem, FlowNodeInstance> datastore;", "type": "AbstractFlowNodeDatastore<FlowNodeItem, FlowNodeInstance>", "var_name": "datastore" } ], "file": "server/src/test/jav...
{ "body": "@Test\n public void makeSearchOptionBuilder_state_Filter_Ongoing_Adds_multiple_entries_in_SearchOption() throws Exception {\n final Map<String, String> filters = new HashMap<String, String>();\n filters.put(FlowNodeInstanceSearchDescriptor.STATE_NAME, \"ongoing\");\n final SearchOpt...
{ "fields": [ { "declarator": "updateHelper", "modifier": "private", "original_string": "private DatastoreHasUpdate<FlowNodeItem> updateHelper;", "type": "DatastoreHasUpdate<FlowNodeItem>", "var_name": "updateHelper" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/...
{ "body": "protected SearchOptionsBuilder makeSearchOptionBuilder(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n final SearchOptionsBuilder builder = SearchOptionsBuilderUtil.buildSearchOptions(page, resultsByPage, 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_39
{ "fields": [ { "declarator": "cacheManager = null", "modifier": "protected", "original_string": "protected CacheManager cacheManager = null;", "type": "CacheManager", "var_name": "cacheManager" } ], "file": "forms/forms-server/src/test/java/org/bonitasoft/forms/server/cache/...
{ "body": "@Test\n public void testGet() {\n CacheUtil.store(cacheManager.getConfiguration().getDiskStoreConfiguration().getPath(), cacheManager.getName(),\n new String(\"testStoreKey\"), new String(\"testStoreValue\"));\n assertNotNull(\"Cannot get the element in the cache\", CacheUti...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(CacheUtil.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(CacheUtil.class.getName());", "type": "Logger", "var_name": "LOGGER" }, { "declarator"...
{ "body": "public static Object get(final String diskStorePath, final String cacheName, final Object key) {\n Object value = null;\n final CacheManager cacheManager = getCacheManager(diskStorePath);\n final Cache cache = cacheManager.getCache(cacheName);\n if (cache != null) {\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_587
{ "fields": [ { "declarator": "result", "modifier": "@Mock", "original_string": "@Mock\n SearchResult<String> result;", "type": "SearchResult<String>", "var_name": "result" }, { "declarator": "converter", "modifier": "@Mock", "original_string": "@Mock\n ...
{ "body": "@Test\n @Ignore(\"itemSearchResult return nbResultsByPage for length, need to be fixed in ItemSearchResult\")\n public void testNumberOfResultCanBeRetrieved() {\n when(result.getResult()).thenReturn(asList(\"item1\", \"item2\", \"item3\"));\n\n ItemSearchResultConverter<IItem, String> i...
{ "fields": [ { "declarator": "page", "modifier": "private", "original_string": "private int page;", "type": "int", "var_name": "page" }, { "declarator": "result", "modifier": "private", "original_string": "private SearchResult<E> result;", "type": "Se...
{ "body": "public ItemSearchResult<I> toItemSearchResult() {\n return new ItemSearchResult<I>(page, nbResultsByPage, total, converter.convert(result.getResult()));\n }", "class_method_signature": "ItemSearchResultConverter.toItemSearchResult()", "constructor": false, "full_signature": "public ItemSear...
{ "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_286
{ "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_custom_page_id() throws Exception {\n given(pageAPI.getPageByName(\"pageToken\")).willReturn(new PageImpl(2L, \"\", \"\", false, false, \"\", 0, 0, 0, 0, \"\", ContentType.PAGE, null));\n given(applicationAPI.searchApplications(a...
{ "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_639
{ "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_FILTER_CONTENT_TYPE_processPage_filter_map_should_return_FILTER_CONTENT_TYPE_form_or_page_in_filter_list() {\n final Map<String, String> filters = new HashMap<>();\n final String form = \"processPage\";\n filters.put(PageItem.FILTER_C...
{ "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_793
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock", "original_string": "@Mock\n ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "caseInfoResource", "modifier": "private", "original_string": "private ...
{ "body": "@Test\n public void should_return_case_info_123() throws DataNotFoundException {\n //given\n final long id = 123;\n doReturn(String.valueOf(id)).when(caseInfoResource).getAttribute(CaseInfoResource.CASE_ID);\n final HashMap<String, Map<String, Long>> taskWithCounters = new Ha...
{ "fields": [ { "declarator": "CASE_ID = \"caseId\"", "modifier": "public static final", "original_string": "public static final String CASE_ID = \"caseId\";", "type": "String", "var_name": "CASE_ID" }, { "declarator": "processAPI", "modifier": "private final", ...
{ "body": "@Get(\"json\")\n public CaseInfo getCaseInfo() {\n try {\n final long caseId = Long.parseLong(getAttribute(CASE_ID));\n final CaseInfo caseInfo = new CaseInfo();\n caseInfo.setId(caseId);\n caseInfo.setFlowNodeStatesCounters(getFlownodeCounters(caseId))...
{ "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_269
{ "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_pagedirectory_be_distinct() throws Exception {\n assertThat(pageResourceProvider.getPageDirectory()).as(\"should be distinct\").isNotEqualTo(pageResourceProviderWithProcessDefinition.getPageDirectory());\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": "@Override\n public File getPageDirectory() {\n return pageDirectory;\n }", "class_method_signature": "PageResourceProviderImpl.getPageDirectory()", "constructor": false, "full_signature": "@Override public File getPageDirectory()", "identifier": "getPageDirectory", "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_140
{ "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_check_csrf_token_from_request_header() throws Exception {\n request.addHeader(\"X-Bonita-API-Token\", SESSION_CSRF_TOKEN);\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isTrue();\n }", "class_method_signature...
{ "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_510
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/member/MemberTypeConverterTest.java", "identifier": "MemberTypeConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMemberTypeConversion() throws Exception {\n MemberTypeConverter converter = new MemberTypeConverter();\n\n MemberType value = converter.convert(AbstractMemberItem.VALUE_MEMBER_TYPE_ROLE);\n\n assertEquals(MemberType.ROLE, value);\n }", "class_method_sign...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/member/MemberTypeConverter.java", "identifier": "MemberTypeConverter", "interfaces": "implements ValueConverter<MemberType>", "methods": [ { "class_method_signature": "MemberTypeConverter.convert(String va...
{ "body": "@Override\n public MemberType convert(String value) {\n return MemberType.from(value);\n }", "class_method_signature": "MemberTypeConverter.convert(String value)", "constructor": false, "full_signature": "@Override public MemberType convert(String value)", "identifier": "convert", "i...
{ "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_843
{ "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(expected = APIException.class)\n public void search_should_throw_an_exception_when_an_order_is_passed_through() throws Exception {\n api.search(0, 1, null, \"NAME ASC\", null);\n }", "class_method_signature": "APICustomUserInfoDefinitionTest.search_should_throw_an_exception_when_an_ord...
{ "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_906
{ "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 testLocaleIsPassedFromRequestToException() throws Exception {\n APIException exception = mock(APIException.class,\n withSettings().defaultAnswer(RETURNS_MOCKS));\n\n doReturn(writer).when(resp).getWriter();\n doReturn(new Cookie[] {\n ...
{ "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_41
{ "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 getThemeLastUpdateDateFromEngine_should_call_getLastUpdateDate_on_Engine() throws Exception {\n themeExtractor.getThemeLastUpdateDateFromEngine(session, ThemeType.PORTAL);\n verify(themeAPI).getLastUpdateDate(ThemeType.PORTAL);\n }", "class_method_signature": "Them...
{ "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": "long getThemeLastUpdateDateFromEngine(final APISession apiSession, ThemeType themeType)\n throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException {\n final ThemeAPI themeAPI = getThemeAPI(apiSession);\n return themeAPI.getLastUpdateDate(themeType).getTime();\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_455
{ "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_creationDate_on_convert_attribute_creationDate() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_CREATION_DATE);\n\n //then\n assertThat(value).isEqualTo(ApplicationSe...
{ "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_681
{ "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 cant_create_case_if_process_is_not_activated() throws Exception {\n when(processAPI.startProcess(anyLong())).thenThrow(new ProcessActivationException(\"\"));\n\n caseEngineClient.start(-1L, 1L);\n }", "class_method_signature": "CaseEn...
{ "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_394
{ "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_TaskContractResource_for_TaskContractResourceFinder() {\n final UserTaskContractResourceFinder userTaskContractResourceFinder = spy(new UserTaskContractResourceFinder());\n doReturn(processAPI).when(userTaskContractResourceFinder).getProcessAPI(any(Request...
{ "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_814
{ "fields": [ { "declarator": "processConnectorDatastore", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessConnectorDatastore processConnectorDatastore;", "type": "ProcessConnectorDatastore", "var_name": "processConnectorDatastore" }, { "...
{ "body": "@Test\n public void searchIsDoneWhenProcessIdFilterIsSet() throws Exception {\n final Map<String, String> filters = new HashMap<String, String>();\n filters.put(ProcessConnectorItem.ATTRIBUTE_PROCESS_ID, \"1\");\n\n this.apiProcessConnector.search(0, 10, null, null, filters);\n\n ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/APIProcessConnector.java", "identifier": "APIProcessConnector", "interfaces": "implements\n APIHasGet<ProcessConnectorItem>,\n APIHasSearch<ProcessConnectorItem>", "methods": [ { "class_method_...
{ "body": "@Override\n public ItemSearchResult<ProcessConnectorItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n if (MapUtil.isBlank(filters, ATTRIBUTE_PROCESS_ID)) {\n throw new APIFilterMandatory...
{ "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_547
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private CaseDocumentDatastore documentDatastore;", "type": "CaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "modifier": "@Moc...
{ "body": "@Test(expected = APIException.class)\n public void it_should_catch_and_throw_APIException_for_not_find_document() throws Exception {\n // Given\n final APIID id = APIID.makeAPIID(1l);\n when(processAPI.getDocument(id.toLong())).thenThrow(new DocumentNotFoundException(\"not found\", ...
{ "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 CaseDocumentItem get(final APIID id) {\n try {\n final Document documentItem = processAPI.getDocument(id.toLong());\n return convertEngineToConsoleItem(documentItem);\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_117
{ "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_true() throws Exception {\n when(processAPI.isInvolvedInProcessInstance(1L, 42L)).thenReturn(true);\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_402
{ "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_extension_resources() throws Exception {\n //given\n final BonitaRestletApplication bonitaRestletApplication = new BonitaRestletApplication(finderFactory, bonitaJacksonConverter);\n\n //when\n bonitaRestletApplication.buildRoute...
{ "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_16
{ "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_process_form_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 boolean a...
{ "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_697
{ "fields": [ { "declarator": "businessDataModelResource", "modifier": "protected", "original_string": "protected BusinessDataModelResource businessDataModelResource;", "type": "BusinessDataModelResource", "var_name": "businessDataModelResource" }, { "declarator": "tena...
{ "body": "@Test\n public void cant_install_bdm_if_tenant_is_not_paused() throws Exception {\n final File bdmFile = testBDMFile();\n final BusinessDataModelItem item = new BusinessDataModelItem();\n item.setFileUpload(bdmFile.getName());\n doReturn(bdmFile.getAbsolutePath()).when(bonita...
{ "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_382
{ "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_BusinessDataReferenceResourceFinder_for_BusinessDataReferenceResource() throws Exception {\n\n final Finder finder = factory.create(BusinessDataReferenceResource.class);\n\n assertThat(finder).isInstanceOf(BusinessDataReferenceResourceFinder.class);\n }...
{ "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_678
{ "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\n public void a_process_can_be_started_without_variables() throws Exception {\n final long expectedProcessId = 1L;\n final long userId = 1L;\n\n caseEngineClient.start(userId, expectedProcessId);\n\n verify(processAPI).startProcess(userId, expectedProcessId);\n }", ...
{ "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_228
{ "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_empty_contract_should_return_unmodified_inputs() throws Exception {\n when(contractDefinition.getInputs()).thenReturn(Collections.<InputDefinition> emptyList());\n final Map<String, Serializable> input = new HashMap<>();\n input.put(\"inpu...
{ "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_101
{ "fields": [ { "declarator": "builder", "modifier": "@Mock", "original_string": "@Mock\n UrlBuilder builder;", "type": "UrlBuilder", "var_name": "builder" } ], "file": "portal/src/test/java/org/bonitasoft/console/client/menu/view/LogoutUrlTest.java", "identifier": "Logo...
{ "body": "@Test\n public void testWeCanSetAParameter() throws Exception {\n LogoutUrl logoutUrl = new LogoutUrl(builder, \"fr\");\n logoutUrl.setParameter(\"aParameter\", \"itsValue\");\n\n new LogoutUrl(builder, \"fr\");\n\n verify(builder).addParameter(\"aParameter\", \"itsValue\");\...
{ "fields": [ { "declarator": "LOGOUT_URL = \"../logoutservice\"", "modifier": "public static final", "original_string": "public static final String LOGOUT_URL = \"../logoutservice\";", "type": "String", "var_name": "LOGOUT_URL" }, { "declarator": "builder", "modi...
{ "body": "public void setParameter(String key, String value) {\n builder.addParameter(key, value);\n }", "class_method_signature": "LogoutUrl.setParameter(String key, String value)", "constructor": false, "full_signature": "public void setParameter(String key, String value)", "identifier": "setPara...
{ "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_551
{ "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_create_documentvalue_with_name_of_the_uploaded_file() throws DocumentException, IOException {\n final URL docUrl = getClass().getResource(\"/doc.jpg\");\n when(tenantFolder.getTempFile(docUrl.getPath(), 1L)).thenReturn(new File(docUrl.getPath()));\n\n /...
{ "fields": [ { "declarator": "constants", "modifier": "protected final", "original_string": "protected final WebBonitaConstantsUtils constants;", "type": "WebBonitaConstantsUtils", "var_name": "constants" }, { "declarator": "processAPI", "modifier": "protected fi...
{ "body": "protected DocumentValue buildDocumentValueFromUploadPath(final String uploadPath, final int index, String fileName)\n throws DocumentException, IOException {\n\n String mimeType = null;\n byte[] fileContent = null;\n\n if (uploadPath != null) {\n final File theSou...
{ "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_802
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APITaskTest.java", "identifier": "APITaskTest", "interfaces": "", "superclass": "extends APITestWithMock" }
{ "body": "@Test\n public void should_have_default_search_order() throws Exception {\n //given\n final APITask apiActivity = new APITask();\n\n //when\n final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder();\n\n //then\n assertThat(defineDefaultSea...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APITask.java", "identifier": "APITask", "interfaces": "", "methods": [ { "class_method_signature": "APITask.isAllowedState(final String state)", "constructor": false, "full_signature": "@Overrid...
{ "body": "@Override\n public String defineDefaultSearchOrder() {\n return TaskItem.ATTRIBUTE_LAST_UPDATE_DATE + ISearchDirection.SORT_ORDER_DESCENDING;\n }", "class_method_signature": "APITask.defineDefaultSearchOrder()", "constructor": false, "full_signature": "@Override public String defineDefau...
{ "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_414
{ "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_do_nothing_when_filters_is_empty() {\n // given:\n final Map<String, String> filters = new HashMap<String, String>(0);\n final SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 10);\n // when:\n ...
{ "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_290
{ "fields": [ { "declarator": "PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\"", "modifier": "public static final", "original_string": "public static final String PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\";", "type": "String", "var_name"...
{ "body": "@Test\n public void should_get_Custom_Page_permissions_from_PageProperties() throws Exception {\n // Given\n final String fileContent = \"name=customPage1\\n\" +\n \"resources=[GET|identity/user, PUT|identity/user]\";\n\n final File pagePropertiesFile = File.createTem...
{ "fields": [ { "declarator": "PAGE_PROPERTIES = \"page.properties\"", "modifier": "private static final", "original_string": "private static final String PAGE_PROPERTIES = \"page.properties\";", "type": "String", "var_name": "PAGE_PROPERTIES" }, { "declarator": "GET_SY...
{ "body": "public Set<String> getCustomPagePermissions(final Properties pageProperties,\n final ResourcesPermissionsMapping resourcesPermissionsMapping,\n final boolean alsoReturnResourcesNotFound) {\n final PropertiesWithSet pagePropertiesWithSet = new PropertiesWithSet(pageProperties);\...
{ "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_785
{ "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 final void fillDeploys_should_do_nothing_when_deploy_of_started_by_is_not_active() {\n // Given\n final CaseItem item = mock(CaseItem.class);\n final List<String> deploys = new ArrayList<String>();\n\n // When\n apiCase.fillDeploys(item, deploys);\n\n ...
{ "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 fillDeploys(final CaseItem item, final List<String> deploys) {\n fillStartedBy(item, deploys);\n fillStartedBySubstitute(item, deploys);\n fillProcess(item, deploys);\n }", "class_method_signature": "APICase.fillDeploys(final CaseItem item, final List...
{ "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_855
{ "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(expected = APIException.class)\n public void should_fail_when_passing_a_no_filter_to_the_search() {\n api.search(0, 2, null, \"Fix order\", null).getResults();\n }", "class_method_signature": "APICustomUserInfoUserTest.should_fail_when_passing_a_no_filter_to_the_search()", "construct...
{ "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": "engineClientCreator", "modifier"...
{ "body": "@Override\n public ItemSearchResult<CustomUserInfoItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n check(containsOnly(FILTER_USER_ID, filters), new _(\"The only mandatory filter is %name%\", new Arg(\"name\", FILTER_USER_ID)));\n chec...
{ "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_506
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntrySearchDescriptorConverterTest.java", "identifier": "ProfileEntrySearchDescriptorConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWeCanConvertTheProfileEntryProfileId() throws Exception {\n String descriptor = new ProfileEntrySearchDescriptorConverter()\n .convert(ProfileEntryItem.ATTRIBUTE_PARENT_ID);\n\n assertEquals(ProfileEntrySearchDescriptor.PARENT_ID, descriptor);\n }"...
{ "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_156
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test\n public void should_checkValidCondition_check_unauthorized_if_no_platform_session() throws ServletException {\n doReturn(\"API/platform/plop\").when(request).getRequestURI();\n doReturn(null).when(httpSession).getAttribute(RestAPIAuthorizationFilter.PLATFORM_SESSION_PARAM_KEY);\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_443
{ "fields": [ { "declarator": "STATE = ApplicationState.DEACTIVATED.name()", "modifier": "private static final", "original_string": "private static final String STATE = ApplicationState.DEACTIVATED.name();", "type": "String", "var_name": "STATE" }, { "declarator": "UPDA...
{ "body": "@Test\n public void applicationItem_with_null_Layout_id_should_not_return_null() throws Exception {\n //given\n final ApplicationImpl application = new ApplicationImpl(DISPLAY_NAME, VERSION, DESCRIPTION, null, THEME_ID);\n application.setId(15);\n application.setDisplayName(D...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/ApplicationItemConverter.java", "identifier": "ApplicationItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ApplicationItemConverter.toApplicationItem(final Application applic...
{ "body": "public ApplicationItem toApplicationItem(final Application application) {\n final ApplicationItem item = new ApplicationItem();\n item.setId(application.getId());\n item.setToken(application.getToken());\n item.setDisplayName(application.getDisplayName());\n item.setVersi...
{ "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_57
{ "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_addPagesOfProfile_complete_set_of_page() throws Exception {\n final Set<String> pages = new HashSet<>();\n doReturn(asList(profileEntryWithPage(\"page1\"), profileEntryWithPage(\"page2\"))).when(profileAPI).getProfileEntries(\"myProfile1\");\n doReturn(asL...
{ "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 addPagesOfProfile(final String profile, final Set<String> pageTokens) throws ProfileNotFoundException {\n final List<ProfileEntry> profileEntries = profileAPI.getProfileEntries(profile);\n for (final ProfileEntry profileEntry : profileEntries) {\n if (profileEntry.getT...
{ "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_204
{ "fields": [ { "declarator": "ICON_ID = 1238970432L", "modifier": "private static final", "original_string": "private static final long ICON_ID = 1238970432L;", "type": "long", "var_name": "ICON_ID" }, { "declarator": "iconServlet", "modifier": "@Spy\n private...
{ "body": "@Test\n public void should_set_special_headers_when_user_agent_is_firefox() throws Exception {\n havingIcon(ICON_ID, \"content\".getBytes());\n httpServletRequest.addHeader(\"User-Agent\", \"Firefox-1238941\");\n httpServletRequest.setPathInfo(\"/\" + String.valueOf(ICON_ID));\n\n ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGER = Logger.getLogger(IconServlet.cla...
{ "body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {\n String iconIdPath = request.getPathInfo();\n if (iconIdPath == null || iconIdPath.isEmpty()) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUE...
{ "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_654
{ "fields": [ { "declarator": "BUNCH_SIZE = 10", "modifier": "private static", "original_string": "private static Integer BUNCH_SIZE = 10;", "type": "Integer", "var_name": "BUNCH_SIZE" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n public void deleteArchivedProcessInstancesByBunch_delete_archived_processes_instances_by_bunch() throws Exception {\n when(processAPI.deleteArchivedProcessInstances(1L, 0, BUNCH_SIZE))\n .thenReturn(BUNCH_SIZE.longValue(), BUNCH_SIZE.longValue(), 0L);\n\n final List<...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(ProcessEngineClient.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(ProcessEngineClient.class.getName());", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public void deleteArchivedProcessInstancesByBunch(final long processId, final int bunchSize, final List<Long> processesAllowedToBeDeletedIds)\n throws DeletionException, ProcessDefinitionNotFoundException {\n long numberOfDeletedArchivedProcessInstances = 0;\n do {\n try...
{ "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_341
{ "fields": [ { "declarator": "applicationApi", "modifier": "@Mock", "original_string": "@Mock\n ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" }, { "declarator": "pageApi", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void should_create_menu_using_menuList() throws Exception {\n final List<ApplicationMenu> menuList = Arrays.<ApplicationMenu> asList(new ApplicationMenuImpl(\"name\", 1L, 2L, 1));\n givenSearchApplicationMenusWillReturns(menuList);\n\n model.getMenuList();\n\n ...
{ "fields": [ { "declarator": "profileApi", "modifier": "private final", "original_string": "private final ProfileAPI profileApi;", "type": "ProfileAPI", "var_name": "profileApi" }, { "declarator": "applicationApi", "modifier": "private final", "original_str...
{ "body": "public List<Menu> getMenuList() throws SearchException, ApplicationPageNotFoundException {\n return factory.create(applicationApi.searchApplicationMenus(new SearchOptionsBuilder(0, Integer.MAX_VALUE)\n .filter(ApplicationMenuSearchDescriptor.APPLICATION_ID, application.getId())\n .sort...
{ "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_711
{ "fields": [ { "declarator": "fakeService", "modifier": "@Mock\n private", "original_string": "@Mock\n private FakeService fakeService;", "type": "FakeService", "var_name": "fakeService" }, { "declarator": "headers = new Series<>(Header.class)", "modifier":...
{ "body": "@Test\n public void notNullMandatoryParameterIsForbidden() throws Exception {\n new CommonResource().verifyNotNullParameter(new Object(), \"unused\");\n // no Exception\n }", "class_method_signature": "CommonResourceTest.notNullMandatoryParameterIsForbidden()", "constructor": false,...
{ "fields": [ { "declarator": "sessionSingleton = null", "modifier": "private", "original_string": "private APISession sessionSingleton = null;", "type": "APISession", "var_name": "sessionSingleton" }, { "declarator": "LOGGER = Logger.getLogger(CommonResource.class.getN...
{ "body": "protected void verifyNotNullParameter(final Object parameter, final String parameterName) throws APIException {\n if (parameter == null) {\n throw new APIException(\"Parameter \" + parameterName + \" is mandatory.\");\n }\n }", "class_method_signature": "CommonResource.verifyN...
{ "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_438
{ "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_delete_the_good_Application_on_delete() throws Exception {\n //given\n\n //when\n dataStore.delete(Arrays.<APIID>asList(APIID.makeAPIID(\"1\"),APIID.makeAPIID(\"2\")));\n\n //then\n verify(applicationAPI, times(1)).deleteApplication(1);\n ...
{ "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 void delete(final List<APIID> ids) {\n try {\n for(final APIID id :ids){\n applicationAPI.deleteApplication(id.toLong());\n }\n } catch (final Exception e) {\n throw new APIException(e);\n }\n }", "class_method_...
{ "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_592
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/converter/LongValueConverterTest.java", "identifier": "LongValueConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLongValueConvertion() throws Exception {\n Long value = new LongValueConverter().convert(\"54\");\n\n assertEquals(Long.valueOf(54L), value);\n }", "class_method_signature": "LongValueConverterTest.testLongValueConvertion()", "constructor": false, "full_sig...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/LongValueConverter.java", "identifier": "LongValueConverter", "interfaces": "implements ValueConverter<Long>", "methods": [ { "class_method_signature": "LongValueConverter.convert(String value)", "...
{ "body": "@Override\n public Long convert(String value) {\n return Long.valueOf(value);\n }", "class_method_signature": "LongValueConverter.convert(String value)", "constructor": false, "full_signature": "@Override public Long convert(String value)", "identifier": "convert", "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_603
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private UserSearchAttributeConverter converter;", "type": "UserSearchAttributeConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/...
{ "body": "@Test\n public void convertLastName() throws Exception {\n String convert = converter.convert(UserItem.ATTRIBUTE_LASTNAME);\n\n assertEquals(UserSearchDescriptor.LAST_NAME, convert);\n }", "class_method_signature": "UserSearchAttributeConverterTest.convertLastName()", "constructor":...
{ "fields": [ { "declarator": "mapping = new HashMap<>()", "modifier": "protected static", "original_string": "protected static Map<String, String> mapping = new HashMap<>();", "type": "Map<String, String>", "var_name": "mapping" }, { "declarator": "valueTypeMapping = n...
{ "body": "@Override\n public String convert(final String attribute) {\n return mapping.get(attribute);\n }", "class_method_signature": "UserSearchAttributeConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String convert(final String attribute)", ...
{ "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_253
{ "fields": [ { "declarator": "request", "modifier": "private", "original_string": "private MockHttpServletRequest request;", "type": "MockHttpServletRequest", "var_name": "request" }, { "declarator": "requestAccessor", "modifier": "private", "original_strin...
{ "body": "@Test\n public void testGetLoginpageURLWithLocale() throws Exception {\n String redirectUrl = \"%2Fportal%2Fhomepage\";\n request.setParameter(\"_l\", \"es\");\n\n String loginURL = standardLoginManagerImpl.getLoginPageURL(requestAccessor, redirectUrl);\n\n assertThat(loginUR...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(StandardAuthenticationManagerImpl.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(StandardAuthenticationManagerImpl.class.getName());", "type": "Logger"...
{ "body": "@Override\n public String getLoginPageURL(final HttpServletRequestAccessor request, final String redirectURL) throws ServletException {\n final StringBuilder url = new StringBuilder();\n String context = request.asHttpServletRequest().getContextPath();\n final String servletPath = r...
{ "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_746
{ "fields": [ { "declarator": "dataStoreFactory", "modifier": "@Mock\n private", "original_string": "@Mock\n private APIApplicationDataStoreFactory dataStoreFactory;", "type": "APIApplicationDataStoreFactory", "var_name": "dataStoreFactory" }, { "declarator": "app...
{ "body": "@Test\n public void should_fill_application_deploy_when_requested() {\n final ApplicationPageItem applicationPage = new ApplicationPageItem();\n applicationPage.setApplicationId(1L);\n final ApplicationItem application = new ApplicationItem();\n application.setDisplayName(\"f...
{ "fields": [ { "declarator": "factory", "modifier": "private final", "original_string": "private final APIApplicationDataStoreFactory factory;", "type": "APIApplicationDataStoreFactory", "var_name": "factory" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/...
{ "body": "@Override\n protected void fillDeploys(final ApplicationPageItem item, final List<String> deploys) {\n addDeployer(new PageDeployer(\n factory.createPageDataStore(getEngineSession()), ApplicationPageItem.ATTRIBUTE_PAGE_ID));\n addDeployer(new ApplicationDeployer(\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_316
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/console/server/ConsoleServiceFactoryTest.java", "identifier": "ConsoleServiceFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getService_should_return_OrganizationImportService_when_organization_import() throws Exception {\n // Given\n ConsoleServiceFactory consoleServiceFacotry = new ConsoleServiceFactory();\n \n // When\n Service service = consoleServiceFacotry.getServic...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/console/server/ConsoleServiceFactory.java", "identifier": "ConsoleServiceFactory", "interfaces": "implements ServiceFactory", "methods": [ { "class_method_signature": "ConsoleServiceFactory.getService(final String calledToolToken)", ...
{ "body": "@Override\n public Service getService(final String calledToolToken) {\n if (OrganizationImportService.TOKEN.equals(calledToolToken)) {\n return new OrganizationImportService();\n } else if (ProcessActorImportService.TOKEN.equals(calledToolToken)) {\n return new Proces...
{ "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_896
{ "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 factoryCreateABooleanConverterForBooleanClassName() throws Exception {\n \n Converter<?> createConverter = factory.createConverter(Boolean.class.getName());\n \n assertTrue(createConverter instanceof BooleanConverter);\n }", "class_method_signature": ...
{ "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_195
{ "fields": [ { "declarator": "urlProtecter = new URLProtector()", "modifier": "", "original_string": "URLProtector urlProtecter = new URLProtector();", "type": "URLProtector", "var_name": "urlProtecter" } ], "file": "server/src/test/java/org/bonitasoft/console/common/server/...
{ "body": "@Test\n public void it_should_filter_double_backslash() {\n assertEquals(\".google.com\", urlProtecter.protectRedirectUrl(\"//www.google.com\"));\n assertEquals(\"google.com\", urlProtecter.protectRedirectUrl(\"//google.com\"));\n }", "class_method_signature": "URLProtectorTest.it_sho...
{ "fields": [ { "declarator": "tokens = Arrays.asList(\"https\", \"http\", \"www\", \"HTTPS\", \"HTTP\", \"WWW\", \"//\")", "modifier": "protected", "original_string": "protected List<String> tokens = Arrays.asList(\"https\", \"http\", \"www\", \"HTTPS\", \"HTTP\", \"WWW\", \"//\");", "typ...
{ "body": "public String protectRedirectUrl(String redirectUrl) {\n if (redirectUrl != null && !redirectUrl.startsWith(\"portal\")) {\n return removeTokenFromUrl(redirectUrl, new ArrayList<String>(tokens));\n }\n return redirectUrl;\n }", "class_method_signature": "URLProtector.pr...
{ "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_480
{ "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\n public void should_delete_the_good_Application_Page_on_delete() throws Exception {\n //given\n\n //when\n dataStore.delete(Arrays.<APIID> asList(APIID.makeAPIID(\"1\"), APIID.makeAPIID(\"2\")));\n\n //then\n verify(applicationAPI, times(1)).deleteApplicationMen...
{ "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 void delete(final List<APIID> ids) {\n try {\n for (final APIID id : ids) {\n applicationAPI.deleteApplicationMenu(id.toLong());\n }\n } catch (final Exception e) {\n throw new APIException(e);\n }\n }", "class_...
{ "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_94
{ "fields": [], "file": "common/src/test/java/org/bonitasoft/web/toolkit/client/common/json/JSonSerializerTest.java", "identifier": "JSonSerializerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_serialize_an_exception() throws Exception {\n Exception exception = new Exception(\"an exception\");\n\n String serialize = JSonSerializer.serialize(exception);\n\n assertThat(serialize).isEqualTo(\"{\\\"exception\\\":\\\"class java.lang.Exception\\\",\\\"...
{ "fields": [], "file": "common/src/main/java/org/bonitasoft/web/toolkit/client/common/json/JSonSerializer.java", "identifier": "JSonSerializer", "interfaces": "", "methods": [ { "class_method_signature": "JSonSerializer.serialize(final JsonSerializable object)", "constructor": false, "f...
{ "body": "public static String serialize(final JsonSerializable object) {\n return serializeInternal(object).toString();\n }", "class_method_signature": "JSonSerializer.serialize(final JsonSerializable object)", "constructor": false, "full_signature": "public static String serialize(final JsonSeriali...
{ "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_879
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private LongConverter converter;", "type": "LongConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/LongConv...
{ "body": "@Test\n public void emptyIsConvertedToNull() throws Exception {\n\n Long converted = converter.convert(\"\");\n\n assertNull(converted);\n }", "class_method_signature": "LongConverterTest.emptyIsConvertedToNull()", "constructor": false, "full_signature": "@Test public void emptyIs...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/LongConverter.java", "identifier": "LongConverter", "interfaces": "implements Converter<Long>", "methods": [ { "class_method_signature": "LongConverter.convert(String toBeConverted)", "...
{ "body": "@Override\n public Long convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Long.parseLong(toBeConverted);\n } catch (NumberFormatException 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_245
{ "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 convertToType_should_ignore_extra_characters_in_String_for_LocalDatesTime() {\n ContractTypeConverter converter = new ContractTypeConverter(ISO_8601_DATE_PATTERNS);\n Map<String, Object> conversionMap = new HashMap<>();\n conversionMap.put(\"1987-12-12T10:00Z\", ...
{ "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": "Object convertToType(final Type type, final Serializable parameterValue) {\n final Class<? extends Serializable> clazz = getClassFromType(type);\n Serializable preprocessedParameterValue = preprocessInputs(type, parameterValue);\n return convertToType(clazz, preprocessedParameterValue)...
{ "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_615
{ "fields": [ { "declarator": "customPageContentValidator", "modifier": "private", "original_string": "private CustomPageContentValidator customPageContentValidator;", "type": "CustomPageContentValidator", "var_name": "customPageContentValidator" }, { "declarator": "exp...
{ "body": "@Test\n public void should_throw_exception_when_page_properties_not_found() throws Exception {\n final File invalidCustomPage = new File(getClass().getResource(\"/invalidCustomPage\").toURI());\n \n expectedException.expect(InvalidPageZipContentException.class);\n expectedExc...
{ "fields": [ { "declarator": "INDEX_GROOVY = \"Index.groovy\"", "modifier": "private static final", "original_string": "private static final String INDEX_GROOVY = \"Index.groovy\";", "type": "String", "var_name": "INDEX_GROOVY" }, { "declarator": "INDEX_HTML = \"index....
{ "body": "public void validate(File pageFolder) throws InvalidPageZipContentException {\n final File[] rootFiles = pageFolder.listFiles();\n if (rootFiles == null) {\n throw new InvalidPageZipContentException(\n \"Content not found.\");\n }\n Properties pageP...
{ "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_300
{ "fields": [ { "declarator": "customPageDependenciesResolver", "modifier": "@Mock\n private", "original_string": "@Mock\n private CustomPageDependenciesResolver customPageDependenciesResolver;", "type": "CustomPageDependenciesResolver", "var_name": "customPageDependenciesResol...
{ "body": "@Test\n public void should__add_bdm_dependencies_in_classloader_before_other_dependencies() throws Exception {\n classLoader = spy(newClassloader());\n final URL[] bdmDependenciesURLs = bdmDependenciesURLs();\n when(bdmDependenciesResolver.getBDMDependencies()).thenReturn(bdmDepende...
{ "fields": [ { "declarator": "nonJarResources = new HashMap<>()", "modifier": "protected", "original_string": "protected Map<String, byte[]> nonJarResources = new HashMap<>();", "type": "Map<String, byte[]>", "var_name": "nonJarResources" }, { "declarator": "isActive =...
{ "body": "public void addCustomPageResources() throws IOException {\n addBDMDependencies();\n addOtherDependencies();\n }", "class_method_signature": "CustomPageChildFirstClassLoader.addCustomPageResources()", "constructor": false, "full_signature": "public void addCustomPageResources()", "i...
{ "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_750
{ "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\n public void sendMessage_should_throw_exception_if_messageName_is_not_set() {\n // given:\n final BPMMessage bpmMessage = new BPMMessage(); // message name not set\n bpmMessage.setTargetProcess(\"myProcess\");\n bpmMessage.setTargetFlowNode(\"activity\");\n\n //...
{ "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_183
{ "fields": [ { "declarator": "req", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest req;", "type": "HttpServletRequest", "var_name": "req" }, { "declarator": "resp", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRespo...
{ "body": "@Test\n public void testUrlIsDroppedWhenParameterIsFirstAndBeforeHash() throws Exception {\n final LoginServlet servlet = new LoginServlet();\n\n final String cleanQueryString = servlet.dropPassword(\"?username=walter.bates&password=bpm#hash\");\n\n assertThat(cleanQueryString, is(\...
{ "fields": [ { "declarator": "serialVersionUID = -5326931127638029215L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -5326931127638029215L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "public String dropPassword(final String content) {\n String tmp = content;\n if (content != null && content.contains(\"password\")) {\n tmp = tmp.replaceAll(\"[&]?password=([^&|#]*)?\", \"\");\n }\n return tmp;\n }", "class_method_signature": "LoginServlet.dropPa...
{ "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_479
{ "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_the_engine_throw_NotFoundException_on_get() throws Exception {\n //given\n given(applicationAPI.getApplicationMenu(1)).willThrow(new ApplicationMenuNotFoundException(\"\"));\n\n //when\n dataSto...
{ "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 get(final APIID id) {\n try {\n final ApplicationMenu applicationMenu = applicationAPI.getApplicationMenu(id.toLong());\n return converter.toApplicationMenuItem(applicationMenu);\n } catch (final Exception e) {\n throw...
{ "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_880
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private LongConverter converter;", "type": "LongConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/LongConv...
{ "body": "@Test\n public void longNumberIsParsedToLong() throws Exception {\n\n long converted = converter.convert(\"456789\");\n\n assertEquals(456789L, converted);\n }", "class_method_signature": "LongConverterTest.longNumberIsParsedToLong()", "constructor": false, "full_signature": "@Tes...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/LongConverter.java", "identifier": "LongConverter", "interfaces": "implements Converter<Long>", "methods": [ { "class_method_signature": "LongConverter.convert(String toBeConverted)", "...
{ "body": "@Override\n public Long convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Long.parseLong(toBeConverted);\n } catch (NumberFormatException 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_82
{ "fields": [ { "declarator": "TENANT_ID = 12L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 12L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "COMPOUND_PERMISSIONS_MAPPING_FILE = \"compound.properties\"", ...
{ "body": "@Test\n public void should_getProperty_return_the_right_resource_permissions() throws Exception {\n\n final ConfigurationFile tenantProperties = new ConfigurationFile(RESOURCES_PERMISSIONS_MAPPING_FILE, TENANT_ID);\n\n final String resourcesValue = tenantProperties.getProperty(\"GET|bpm/id...
{ "fields": [ { "declarator": "propertiesFilename", "modifier": "private final", "original_string": "private final String propertiesFilename;", "type": "String", "var_name": "propertiesFilename" }, { "declarator": "tenantId", "modifier": "private final", "or...
{ "body": "public String getProperty(final String propertyName) {\n return getPropertiesOfScope().getProperty(propertyName);\n }", "class_method_signature": "ConfigurationFile.getProperty(final String propertyName)", "constructor": false, "full_signature": "public String getProperty(final String prope...
{ "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_496
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileSearchDescriptorConverterTest.java", "identifier": "ProfileSearchDescriptorConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWeCanConvertTheProfileId() throws Exception {\n String descriptor = new ProfileSearchDescriptorConverter().convert(ProfileItem.ATTRIBUTE_ID);\n\n assertEquals(ProfileSearchDescriptor.ID, descriptor);\n }", "class_method_signature": "ProfileSearchDescriptorConve...
{ "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_642
{ "fields": [ { "declarator": "profileAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProfileAPI profileAPI;", "type": "ProfileAPI", "var_name": "profileAPI" }, { "declarator": "engineClient", "modifier": "private", "original_s...
{ "body": "@Test\n public void searchProfileEntries_call_engine_and_get_specific_results() throws SearchException {\n SearchOptions searchOptions = new SearchOptionsBuilder(0, 10).done();\n engineClient.searchProfiles(searchOptions);\n \n verify(profileAPI).searchProfileEntries(searchOp...
{ "fields": [ { "declarator": "profileApi", "modifier": "private final", "original_string": "private final ProfileAPI profileApi;", "type": "ProfileAPI", "var_name": "profileApi" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/ProfileEntryEngine...
{ "body": "public SearchResult<ProfileEntry> searchProfiles(final SearchOptions options) {\n try {\n return profileApi.searchProfileEntries(options);\n } catch (final InvalidSessionException e) {\n throw new APISessionInvalidException(e);\n } catch (final SearchException 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_212
{ "fields": [ { "declarator": "tempFolder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "tempFolder" }, { "declarator": "fileU...
{ "body": "@Test\n public void should_set_413_status_code_with_empty_body_when_file_creates_OOMError() throws Exception {\n final ServletFileUpload serviceFileUpload = mock(ServletFileUpload.class);\n final HttpServletResponse response = mock(HttpServletResponse.class);\n final PrintWriter pri...
{ "fields": [ { "declarator": "serialVersionUID = 58370675886169565L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 58370675886169565L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "server/src/main/java/...
{ "body": "@Override\n protected void defineUploadDirectoryPath(final HttpServletRequest request) {\n final long tenantId = getAPISession(request).getTenantId();\n setUploadDirectoryPath(WebBonitaConstantsUtils.getInstance(tenantId).getTempFolder().getPath());\n }", "class_method_signature": "Te...
{ "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" }