id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
11337147_488
{ "fields": [ { "declarator": "tenantAdminDatastore = null", "modifier": "private", "original_string": "private TenantAdminDatastore tenantAdminDatastore = null;", "type": "TenantAdminDatastore", "var_name": "tenantAdminDatastore" }, { "declarator": "tenantAdministratio...
{ "body": "@Test\n public void testGetTenantInMaintenance() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(true);\n final APIID apiid = APIID.makeAPIID(1L);\n\n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.get(apiid);\n\n verify(tenantAdministra...
{ "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 get(final APIID id) {\n final TenantAdminItem tenantAdminItem = new TenantAdminItem();\n try {\n final boolean tenantPaused = getTenantManagementEngineClient().isTenantPaused();\n tenantAdminItem.setIsPaused(tenantPaused);\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_172
{ "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 testtSanitizeLoginPageUrlEmptyLoginPageUrl() throws Exception {\n String loginPage = logoutServlet.sanitizeLoginPageUrl(\"\");\n \n assertThat(loginPage).isEqualToIgnoringCase(\"\");\n }", "class_method_signature": "LogoutServletTest.testtSanitizeLoginPageUr...
{ "fields": [ { "declarator": "serialVersionUID = 739607235407639011L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 739607235407639011L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGIN_P...
{ "body": "protected String sanitizeLoginPageUrl(final String loginURL) {\n return new RedirectUrlBuilder(new URLProtector().protectRedirectUrl(loginURL)).build().getUrl();\n }", "class_method_signature": "LogoutServlet.sanitizeLoginPageUrl(final String loginURL)", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_467
{ "fields": [ { "declarator": "converter = new ApplicationMenuSearchDescriptorConverter()", "modifier": "private final", "original_string": "private final ApplicationMenuSearchDescriptorConverter converter = new ApplicationMenuSearchDescriptorConverter();", "type": "ApplicationMenuSearchDe...
{ "body": "@Test\n public void should_return_ApplicationMenuSearchDescriptor_index_on_convert_attribute_parent_menu() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationMenuItem.ATTRIBUTE_PARENT_MENU_ID);\n\n //then\n assertThat(convertedValue).isEq...
{ "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/applicationm...
{ "body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }", "class_method_signature": "ApplicationMenuSearchDescriptorConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String conv...
{ "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_73
{ "fields": [ { "declarator": "request", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" } ], "file": "common/src/test/java/org/bonitasoft/console/common/server/utils/Lo...
{ "body": "@Test\n public void testWeCanRetrieveLocaleFromCookie() throws Exception {\n Cookie[] cookies = {\n new Cookie(LocaleUtils.LOCALE_COOKIE_NAME, \"en_US\"),\n };\n doReturn(cookies).when(request).getCookies();\n\n String locale = LocaleUtils.getUserLocaleAsString...
{ "fields": [ { "declarator": "LOCALE_PARAM = \"locale\"", "modifier": "public static final", "original_string": "public static final String LOCALE_PARAM = \"locale\";", "type": "String", "var_name": "LOCALE_PARAM" }, { "declarator": "PORTAL_LOCALE_PARAM = \"_l\"", ...
{ "body": "public static String getUserLocaleAsString(final HttpServletRequest request) {\n String locale = getLocaleFromRequestURL(request);\n if (locale == null) {\n locale = getStandardizedLocaleFromCookie(request);\n }\n if (locale == null) {\n String browserLocal...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_719
{ "fields": [ { "declarator": "RETURN_VALUE = \"{'return':'value'}\"", "modifier": "public static final", "original_string": "public static final String RETURN_VALUE = \"{'return':'value'}\";", "type": "String", "var_name": "RETURN_VALUE" }, { "declarator": "GET = \"GET...
{ "body": "@Test\n public void should_handle_return_result() throws Exception {\n //given\n method = new Method(GET);\n doReturn(method).when(request).getMethod();\n final RestApiResponse restApiResponse = new RestApiResponseBuilder().withResponse(RETURN_VALUE).build();\n doRetur...
{ "fields": [ { "declarator": "EMPTY_RESPONSE = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_RESPONSE = \"\";", "type": "String", "var_name": "EMPTY_RESPONSE" }, { "declarator": "restApiRenderer", "modifier": "priv...
{ "body": "@Override\n public Representation doHandle() {\n final StringRepresentation stringRepresentation = new StringRepresentation(EMPTY_RESPONSE);\n try {\n final RestApiResponse restApiResponse = handleRequest();\n fillAllContent(stringRepresentation, restApiResponse);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_349
{ "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_hasPage_return_false() throws Exception {\n given(applicationApi.getApplicationPage(\"token\", \"pageToken\")).willThrow(new ApplicationPageNotFoundException(\"\"));\n\n assertThat(model.hasPage(\"pageToken\")).isEqualTo(false);\n }", "class_method_signature...
{ "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 hasPage(final String pageToken) {\n try {\n applicationApi.getApplicationPage(application.getToken(), pageToken);\n return true;\n } catch (final ApplicationPageNotFoundException e) {\n return false;\n }\n }", "class_method_signature...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_125
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedAsAdminOrProcessSupervisor_should_assign_task() throws Exception {\n final long processDefinitionId = 2L;\n final long doForUser = 5L;\n final long taskId = 42L;\n final Set<String> userPermissions = new HashSet<String>();\n when(httpSessio...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedAsAdminOrProcessSupervisor(final HttpServletRequest request, final APISession apiSession, final long processDefinitionId,\n final long taskInstanceId, final long userId, final boolean assignTask) throws BonitaException {\n if (isLoggedUserAdmin(request) || isLogged...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_575
{ "fields": [ { "declarator": "processDatastore", "modifier": "private", "original_string": "private ProcessDatastore processDatastore;", "type": "ProcessDatastore", "var_name": "processDatastore" }, { "declarator": "engineSession", "modifier": "@Mock\n private...
{ "body": "@Test\n public void should_retrieve_the_autologin_configuration_when_updating_the_process_state() throws Exception {\n\n final long tenantId = 1L;\n doReturn(tenantId).when(engineSession).getTenantId();\n final APIID id = APIID.makeAPIID(2L);\n final Map<String, String> attri...
{ "fields": [ { "declarator": "logger = Logger.getLogger(ProcessDatastore.class.getName())", "modifier": "private static final", "original_string": "private static final Logger logger = Logger.getLogger(ProcessDatastore.class.getName());", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public ProcessItem update(final APIID id, final Map<String, String> attributes) {\n final ProcessDeploymentInfoUpdater updater = new ProcessDeploymentInfoUpdater();\n\n final ProcessEngineClient engineClient = getProcessEngineClient();\n if (attributes.containsKey(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_826
{ "fields": [ { "declarator": "datastore", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessConnectorDependencyDatastore datastore;", "type": "ProcessConnectorDependencyDatastore", "var_name": "datastore" }, { "declarator": "apiProcessConn...
{ "body": "@Test(expected = APIFilterMandatoryException.class)\n public void searchCheckMandatoryAttributes() throws Exception {\n Map<String, String> filtersWithoutProcessId = buildFilters(null, \"aConnectorName\", \"aConnectorVersion\");\n \n apiProcessConnectorDependency.search(0, 10, null,...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/APIProcessConnectorDependency.java", "identifier": "APIProcessConnectorDependency", "interfaces": "implements\n APIHasSearch<ProcessConnectorDependencyItem>", "methods": [ { "class_method_signature": ...
{ "body": "@Override\n public ItemSearchResult<ProcessConnectorDependencyItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n checkMandatoryAttributes(filters);\n return super.search(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_24
{ "fields": [ { "declarator": "util = new FormFieldValuesUtil()", "modifier": "", "original_string": "FormFieldValuesUtil util = new FormFieldValuesUtil();", "type": "FormFieldValuesUtil", "var_name": "util" } ], "file": "forms/forms-server/src/test/java/org/bonitasoft/forms/...
{ "body": "@Test\n public void testWeDoNotRetrieveDisplayExpressionOfWidgetNotDisplayed() {\n final FormWidget widget = new FormWidget();\n widget.setId(\"widget\");\n final Expression expression = new Expression();\n expression.setName(\"expression\");\n widget.setDisplayConditi...
{ "fields": [ { "declarator": "INDEX_SEPARATOR = \"_\"", "modifier": "protected static final", "original_string": "protected static final String INDEX_SEPARATOR = \"_\";", "type": "String", "var_name": "INDEX_SEPARATOR" }, { "declarator": "WIDGET_LABEL = \"label\"", ...
{ "body": "protected List<Expression> getExpressionsToEvaluation(final List<FormWidget> widgets,\n final Map<String, Serializable> resolvedDisplayExp,\n final Map<String, Object> context) {\n final List<Expression> expressionsToEvaluate = new ArrayList<Expression>();\n for (final F...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_430
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/filter/GenericFilterCreatorTest.java", "identifier": "GenericFilterCreatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void method_create_should_handle_boolean_values() {\n AttributeConverter converter = new AttributeConverter() {\n\n @Override\n public String convert(String attribute) {\n return attribute;\n }\n\n @Override\n pu...
{ "fields": [ { "declarator": "fieldConverter", "modifier": "protected", "original_string": "protected AttributeConverter fieldConverter;", "type": "AttributeConverter", "var_name": "fieldConverter" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/f...
{ "body": "@Override\n public Filter<? extends Serializable> create(String attribute, String value) {\n return new Filter<>(new Field(attribute, fieldConverter), getTypedValue(attribute, value));\n }", "class_method_signature": "GenericFilterCreator.create(String attribute, String value)", "construct...
{ "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_627
{ "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 testBuildPageCreatorFrom() {\n final String testUrlTokenString = \"testUrlTokenString\";\n final String testContentNameString = \"testContentName\";\n final String testDescriptionString = \"testDescriptionString\";\n final String testDisplayNameString = \"...
{ "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 PageCreator buildPageCreatorFrom(final PageItem pageItem) {\n final PageCreator pageCreator = new PageCreator(pageItem.getUrlToken(), pageItem.getContentName());\n pageCreator.setDescription(pageItem.getDescription());\n pageCreator.setDisplayName(pageItem.getDisplayName());\...
{ "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_277
{ "fields": [ { "declarator": "MY_PROFILE = \"myProfile\"", "modifier": "public static final", "original_string": "public static final String MY_PROFILE = \"myProfile\";", "type": "String", "var_name": "MY_PROFILE" }, { "declarator": "pageContextHelper", "modifier...
{ "body": "@Test\n public void should_getCurrentLocale_return_default_locale() throws Exception {\n //given\n Cookie[] cookieList = new Cookie[1];\n cookieList[0] = new Cookie(\"otherCookie\", \"otherValue\");\n\n doReturn(null).when(request).getParameter(LocaleUtils.LOCALE_PARAM);\n ...
{ "fields": [ { "declarator": "PROFILE_PARAM = \"profile\"", "modifier": "public static final", "original_string": "public static final String PROFILE_PARAM = \"profile\";", "type": "String", "var_name": "PROFILE_PARAM" }, { "declarator": "ATTRIBUTE_API_SESSION = \"apiS...
{ "body": "public Locale getCurrentLocale() {\n return LocaleUtils.getUserLocale(request);\n }", "class_method_signature": "PageContextHelper.getCurrentLocale()", "constructor": false, "full_signature": "public Locale getCurrentLocale()", "identifier": "getCurrentLocale", "invocations": [ "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_298
{ "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_custom_page_jar_resources_in_classloader_urls() throws Exception {\n classLoader = newClassloader();\n when(customPageDependenciesResolver.resolveCustomPageDependencies()).thenReturn(loadedResources(\"util.jar\"));\n\n classLoader.addCustomPageResource...
{ "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_762
{ "fields": [ { "declarator": "apiDocument", "modifier": "@Spy\n private", "original_string": "@Spy\n private APICaseDocument apiDocument;", "type": "APICaseDocument", "var_name": "apiDocument" }, { "declarator": "datastore", "modifier": "@Mock\n private"...
{ "body": "@Test\n public void it_should_call_the_datastore_search_method() {\n // When\n apiDocument.search(0, 10, \"hello\", \"documentName ASC\", null);\n\n // Then\n verify(datastore).search(0, 10, \"hello\", null, \"documentName ASC\");\n }", "class_method_signature": "APICase...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/cases/APICaseDocument.java", "identifier": "APICaseDocument", "interfaces": "", "methods": [ { "class_method_signature": "APICaseDocument.defineItemDefinition()", "constructor": false, "full_signature": ...
{ "body": "@Override\n public ItemSearchResult<CaseDocumentItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n final ItemSearchResult<CaseDocumentItem> results = getCaseDocumentDatastore().search(page, resultsB...
{ "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_332
{ "fields": [ { "declarator": "aMenuLink", "modifier": "", "original_string": "ApplicationMenuImpl aMenuLink;", "type": "ApplicationMenuImpl", "var_name": "aMenuLink" }, { "declarator": "aMenuContainer", "modifier": "", "original_string": "ApplicationMenuImp...
{ "body": "@Test\n public void should_create_a_MenuLink_with_the_page_token_it_is_pointing_at_when_menu_is_a_link() throws Exception {\n MenuFactory factory = new MenuFactory(applicationApi);\n\n assertThat(factory.create(asList((ApplicationMenu) aMenuLink)).get(0).getHtml())\n .isEqua...
{ "fields": [ { "declarator": "applicationApi", "modifier": "private final", "original_string": "private final ApplicationAPI applicationApi;", "type": "ApplicationAPI", "var_name": "applicationApi" } ], "file": "server/src/main/java/org/bonitasoft/livingapps/menu/MenuFactory...
{ "body": "public List<Menu> create(final List<ApplicationMenu> menuList) throws ApplicationPageNotFoundException, SearchException {\n return collect(menuList, new RootMenuCollector());\n }", "class_method_signature": "MenuFactory.create(final List<ApplicationMenu> menuList)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_220
{ "fields": [ { "declarator": "request", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" }, { "declarator": "fileUploadServlet = new TenantFileUploadServlet()", "modifier": "@Spy...
{ "body": "@Test\n public void getExtension_should_return_an_empty_extension_for_parent_folder_filename() throws IOException {\n // given\n final String filename = \"../../../\";\n\n // when\n final String extension = fileUploadServlet.getExtension(filename);\n\n // then\n ...
{ "fields": [ { "declarator": "serialVersionUID = -948661031179067420L", "modifier": "protected static final", "original_string": "protected static final long serialVersionUID = -948661031179067420L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "L...
{ "body": "protected String getExtension(final String fileName) {\n String extension = \"\";\n final String filenameLastSegment = getFilenameLastSegment(fileName);\n final int dotPos = filenameLastSegment.lastIndexOf('.');\n if (dotPos > -1) {\n extension = filenameLastSegment.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_670
{ "fields": [ { "declarator": "groupAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" }, { "declarator": "groupEngineClient", "modifier": "private", "original_string...
{ "body": "@Test(expected = APIException.class)\n public void delete_throw_APIException_if_an_error_occurs_when_deleting_groups_in_engine_repository() throws Exception {\n List<Long> groupIds = asList(1L, 2L);\n doThrow(new DeletionException(\"error\")).when(groupAPI).deleteGroups(groupIds);\n ...
{ "fields": [ { "declarator": "groupAPI", "modifier": "private", "original_string": "private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/GroupEngineClient.java", "identifier":...
{ "body": "public void delete(List<Long> groupIds) {\n try {\n groupAPI.deleteGroups(groupIds);\n } catch (DeletionException e) {\n throw new APIException(new _(\"Error when deleting groups\"), e);\n }\n }", "class_method_signature": "GroupEngineClient.delete(List<Long>...
{ "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_365
{ "fields": [ { "declarator": "hsRequest", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest hsRequest;", "type": "HttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse", "modifier": "@Mock", "original_string": "@Mo...
{ "body": "@Test\n public void should_send_error_404_when_the_application_page_is_not_found() throws Exception {\n doThrow(new ApplicationPageNotFoundException(\"error\")).when(router).route(eq(hsRequest), eq(hsResponse), eq(session), eq(pageRenderer), eq(resourceRenderer), any(BonitaHomeFolderAccessor.clas...
{ "fields": [ { "declarator": "serialVersionUID = -3911437607969651000L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3911437607969651000L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "@Override\n protected void service(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse)\n throws ServletException, IOException {\n\n final APISession session = getSession(hsRequest);\n\n // Check if requested URL is missing final slash (necessary in order to...
{ "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_735
{ "fields": [ { "declarator": "getter", "modifier": "@Mock\n private", "original_string": "@Mock\n private DatastoreHasGet<UserItem> getter;", "type": "DatastoreHasGet<UserItem>", "var_name": "getter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api...
{ "body": "@Test\n public void testNotDeployableAttributeIsNotDeployed() throws Exception {\n prepareGetterToReturnAUser();\n ReportItem report = aReportInstalledBy(null);\n\n UserDeployer nameDeployer = new UserDeployer(getter, ReportItem.ATTRIBUTE_INSTALLED_BY);\n nameDeployer.deployI...
{ "fields": [ { "declarator": "getter", "modifier": "private final", "original_string": "private final DatastoreHasGet<UserItem> getter;", "type": "DatastoreHasGet<UserItem>", "var_name": "getter" }, { "declarator": "attribute", "modifier": "private final", ...
{ "body": "@Override\n public void deployIn(IItem item) {\n if (isDeployable(attribute, item)) {\n item.setDeploy(attribute, getUser(getUserId(item)));\n }\n }", "class_method_signature": "UserDeployer.deployIn(IItem item)", "constructor": false, "full_signature": "@Override publi...
{ "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_559
{ "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_call_processAPI_searchDocuments_method() throws SearchException {\n // Given\n when(processAPI.searchDocuments(any(SearchOptions.class))).thenReturn(mockedEngineSearchResults);\n final Map<String, String> filters = new HashMap<>();\n filters.put(...
{ "fields": [ { "declarator": "constants", "modifier": "protected final", "original_string": "protected final WebBonitaConstantsUtils constants;", "type": "WebBonitaConstantsUtils", "var_name": "constants" }, { "declarator": "processAPI", "modifier": "protected fi...
{ "body": "protected ItemSearchResult<CaseDocumentItem> searchDocument(final int page, final int resultsByPage, final String search,\n final Map<String, String> filters, final String orders) {\n\n try {\n final APIID supervisorAPIID = APIID.makeAPIID(filters.get(CaseDocumentItem.FILTER_SU...
{ "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_109
{ "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 getTaskInstanceId_with_taskInstanceId_on_archived_instance() throws Exception {\n when(processAPI.searchMyAvailableHumanTasks(anyLong(), any(SearchOptions.class))).thenReturn(mock(SearchResult.class));\n final ArchivedHumanTaskInstance archivedHumanTaskInstance = mock(A...
{ "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 long getTaskInstanceId(final APISession apiSession, final long processInstanceId, final String taskName, final long userId)\n throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n long ensuredUserId;\n if (userId != -1L) {\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_666
{ "fields": [ { "declarator": "engine", "modifier": "@Mock\n private", "original_string": "@Mock\n private IdentityAPI engine;", "type": "IdentityAPI", "var_name": "engine" }, { "declarator": "client", "modifier": "@InjectMocks\n private", "original...
{ "body": "@Test\n public void should_the_value_of_a_given_custom_user_info() throws UpdateException {\n CustomUserInfoValueImpl value = new CustomUserInfoValueImpl();\n value.setValue(\"foo\");\n given(engine.setCustomUserInfoValue(1L, 2L, \"foo\")).willReturn(value);\n\n CustomUserInf...
{ "fields": [ { "declarator": "identity", "modifier": "private", "original_string": "private IdentityAPI identity;", "type": "IdentityAPI", "var_name": "identity" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CustomUserInfoEngineClient.java", ...
{ "body": "public CustomUserInfoValue setCustomUserInfoValue(long definitionId, long userId, String value) {\n try {\n return identity.setCustomUserInfoValue(definitionId, userId, value);\n } catch (UpdateException e) {\n throw new APIItemNotFoundException(org.bonitasoft.web.rest.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_236
{ "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_simple_input_should_return_processed_input_with_empty_map() throws Exception {\n final List<InputDefinition> inputDefinition = generateSimpleInputDefinition(true);\n when(contractDefinition.getInputs()).thenReturn(inputDefinition);\n final...
{ "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_723
{ "fields": [ { "declarator": "RETURN_VALUE = \"{'return':'value'}\"", "modifier": "public static final", "original_string": "public static final String RETURN_VALUE = \"{'return':'value'}\";", "type": "String", "var_name": "RETURN_VALUE" }, { "declarator": "GET = \"GET...
{ "body": "@Test\n public void should_handle_content_range_and_location_with_restlet_representation() throws Exception {\n //given\n String location = \"https://documentation.bonitasoft.com/bonita/7.7/\";\n method = new Method(GET);\n doReturn(method).when(request).getMethod();\n ...
{ "fields": [ { "declarator": "EMPTY_RESPONSE = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_RESPONSE = \"\";", "type": "String", "var_name": "EMPTY_RESPONSE" }, { "declarator": "restApiRenderer", "modifier": "priv...
{ "body": "@Override\n public Representation doHandle() {\n final StringRepresentation stringRepresentation = new StringRepresentation(EMPTY_RESPONSE);\n try {\n final RestApiResponse restApiResponse = handleRequest();\n fillAllContent(stringRepresentation, restApiResponse);\n ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_689
{ "fields": [ { "declarator": "businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder()", "modifier": "private", "original_string": "private BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder();", "type":...
{ "body": "@Test\n public void should_handle_simple_business_data() throws Exception {\n //given\n SimpleBusinessDataReferenceImpl bizDataRef = new SimpleBusinessDataReferenceImpl(\"Ticket\", \"com.acme.object.Ticket\", 8L);\n\n //when\n boolean handlesResource = businessDataReferenceRe...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceResourceFinder.java", "identifier": "BusinessDataReferenceResourceFinder", "interfaces": "", "methods": [ { "class_method_signature": "BusinessDataReferenceResourceFinder.create(final Request re...
{ "body": "@Override\n public boolean handlesResource(Serializable object) {\n return object instanceof BusinessDataReference;\n }", "class_method_signature": "BusinessDataReferenceResourceFinder.handlesResource(Serializable object)", "constructor": false, "full_signature": "@Override public boolea...
{ "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_373
{ "fields": [ { "declarator": "hsRequest", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest hsRequest;", "type": "HttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse", "modifier": "@Mock", "original_string": "@Mo...
{ "body": "@Test\n public void should_not_redirectToValidPageUrl_on_resource_query() throws Exception {\n doReturn(\"/appToken/pageToken/file.css\").when(hsRequest).getPathInfo();\n\n servlet.service(hsRequest, hsResponse);\n\n verify(customPageRequestModifier, times(0)).redirectToValidPageUrl...
{ "fields": [ { "declarator": "serialVersionUID = -3911437607969651000L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3911437607969651000L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "@Override\n protected void service(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse)\n throws ServletException, IOException {\n\n final APISession session = getSession(hsRequest);\n\n // Check if requested URL is missing final slash (necessary in order to...
{ "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_261
{ "fields": [ { "declarator": "PAGE_ID = 42L", "modifier": "public static final", "original_string": "public static final long PAGE_ID = 42L;", "type": "long", "var_name": "PAGE_ID" }, { "declarator": "pageRenderer", "modifier": "@Mock", "original_string": "...
{ "body": "@Test\n public void should_get_not_found_when_engine_throw_not_found() throws Exception {\n final String key = \"process/processName/processVersion\";\n when(hsRequest.getPathInfo()).thenReturn(\"/\" + key + \"/content/\");\n doThrow(NotFoundException.class).when(pageMappingService)...
{ "fields": [ { "declarator": "serialVersionUID = 2789496969243916444L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 2789496969243916444L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGE...
{ "body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n\n if (!pathInfo.contains(RESOURCE_PATH_SEPARATOR + \"/\") && pathInfo.indexOf(API_PATH_SEPARATO...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_631
{ "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 should_ConvertEngineToConsoleItem_returns_null_if_item_is_null() {\n assertThat(pageDatastore.convertEngineToConsoleItem(null)).isNull();\n }", "class_method_signature": "PageDatastoreTest.should_ConvertEngineToConsoleItem_returns_null_if_item_is_null()", "constructor":...
{ "fields": [ { "declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"", "modifier": "public static final", "original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";", "type": "String", "var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE" }, { "de...
{ "body": "@Override\n protected PageItem convertEngineToConsoleItem(final Page item) {\n if (item != null) {\n return new PageItemConverter().convert(item);\n }\n return null;\n }", "class_method_signature": "PageDatastore.convertEngineToConsoleItem(final Page item)", "const...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_324
{ "fields": [ { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ApplicationAPI applicationAPI;", "type": "ApplicationAPI", "var_name": "applicationAPI" }, { "declarator": "tenantFolder", "modifier": "@Mock\n...
{ "body": "@Test\n public void should_getFileFormatExceptionMessage_talk_about_application() throws Exception {\n assertEquals(spiedApplicationImportService.getFileFormatExceptionMessage(), \"Can't import Applications.\");\n }", "class_method_signature": "ApplicationsImportServiceTest.should_getFileFor...
{ "fields": [ { "declarator": "TOKEN = \"/application/import\"", "modifier": "public final static", "original_string": "public final static String TOKEN = \"/application/import\";", "type": "String", "var_name": "TOKEN" }, { "declarator": "FILE_UPLOAD = \"applicationsDa...
{ "body": "@Override\n protected String getFileFormatExceptionMessage() {\n return _(\"Can't import Applications.\", getLocale());\n }", "class_method_signature": "ApplicationsImportService.getFileFormatExceptionMessage()", "constructor": false, "full_signature": "@Override protected String getFile...
{ "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_774
{ "fields": [ { "declarator": "apiCaseVariable", "modifier": "private", "original_string": "private APICaseVariable apiCaseVariable;", "type": "APICaseVariable", "var_name": "apiCaseVariable" }, { "declarator": "datastore", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void getSearchInDatastoreById() throws Exception {\n long expectedCaseId = 1L;\n String expectedVariableName = \"aName\";\n APIID apiid = buildAPIID(expectedCaseId, expectedVariableName);\n\n apiCaseVariable.runGet(apiid, null, null);\n\n verify(datastor...
{ "fields": [ { "declarator": "attributeChecker = new APICaseVariableAttributeChecker()", "modifier": "private", "original_string": "private APICaseVariableAttributeChecker attributeChecker = new APICaseVariableAttributeChecker();", "type": "APICaseVariableAttributeChecker", "var_nam...
{ "body": "@Override\n public CaseVariableItem runGet(APIID id, List<String> deploys, List<String> counters) {\n id.setItemDefinition(CaseVariableDefinition.get());\n long caseId = id.getPartAsLong(CaseVariableItem.ATTRIBUTE_CASE_ID);\n String variableName = id.getPart(CaseVariableItem.ATTRIBU...
{ "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_49
{ "fields": [ { "declarator": "directory = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder directory = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "directory" }, { "declarator": "modifier...
{ "body": "@Test\n public void should_add_compiled_file_to_compile_less_into_css() throws Exception {\n final File lessStyle = directory.newFile(\"style.less\");\n given(modifier.resolve(\"style.less\")).willReturn(lessStyle);\n\n new CompilableFile(\"style.less\", \"style.css\").compile(modif...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(CompilableFile.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(CompilableFile.class.getName());", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public byte[] compile(final ThemeArchive.ThemeModifier modifier) {\n final LessCompiler lessCompiler = new LessCompiler();\n lessCompiler.setEncoding(\"UTF-8\");\n File file = modifier.resolve(input);\n if (!Files.exists(file.toPath())) {\n LOGGER.warning(format(\"The...
{ "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_518
{ "fields": [ { "declarator": "converter = new ApplicationPageSearchDescriptorConverter()", "modifier": "private final", "original_string": "private final ApplicationPageSearchDescriptorConverter converter = new ApplicationPageSearchDescriptorConverter();", "type": "ApplicationPageSearchDe...
{ "body": "@Test\n public void should_return_ApplicationPageSearchDescriptor_pageId_on_convert_attribute_pageId() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationPageItem.ATTRIBUTE_PAGE_ID);\n\n //then\n assertThat(convertedValue).isEqualTo(Appli...
{ "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/applicationp...
{ "body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }", "class_method_signature": "ApplicationPageSearchDescriptorConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String conv...
{ "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_148
{ "fields": [ { "declarator": "SESSION_CSRF_TOKEN = \"csrftoken\"", "modifier": "public static final", "original_string": "public static final String SESSION_CSRF_TOKEN = \"csrftoken\";", "type": "String", "var_name": "SESSION_CSRF_TOKEN" }, { "declarator": "request = n...
{ "body": "@Test\n public void should_set_401_status_when_csrf_form_data_is_wrong() throws Exception {\n request = mockMultipartRequestFor(\"notAValidToken\");\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isFalse();\n assertThat(response.getSt...
{ "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_580
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "categoryDatastore", "modifier": "private", "origi...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test(expected = APIForbiddenException.class)\n public void addingTwiceSameCategoryIsForbidden() throws Exception {\n when(processAPI.createCategory(anyString(), anyString())).thenThrow(new AlreadyExistsException(\"category already exists\"));\n\n cate...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/CategoryDatastore.java", "identifier": "CategoryDatastore", "interfaces": "implements\n DatastoreHasSearch<CategoryItem>,\n DatastoreHasGet<CategoryItem>,\n DatastoreHasDelete,\n Datast...
{ "body": "@Override\n public CategoryItem add(final CategoryItem item) {\n try {\n final Category result = getProcessAPI().createCategory(item.getName(), item.getDescription());\n return convertEngineToConsoleItem(result);\n } catch (final AlreadyExistsException 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_703
{ "fields": [ { "declarator": "caller", "modifier": "@Mock", "original_string": "@Mock\n APIServletCall caller;", "type": "APIServletCall", "var_name": "caller" }, { "declarator": "session", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test(expected = APIException.class)\n public void it_throws_an_exception_when_cannot_write_file_on_add() throws Exception {\n // Given\n doThrow(new IOException(\"error\")).when(documentDatastore).createDocument(any(Long.class), any(String.class), any(String.class),\n any(S...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/document/APIDocument.java", "identifier": "APIDocument", "interfaces": "", "methods": [ { "class_method_signature": "APIDocument.defineItemDefinition()", "constructor": false, "full_signature": "@Override pr...
{ "body": "@Override\n public DocumentItem add(final DocumentItem item) {\n final long processInstanceId = Long.valueOf(item.getAttributeValue(DocumentItem.PROCESSINSTANCE_ID));\n final String documentName = item.getAttributeValue(DocumentItem.DOCUMENT_NAME);\n final String path = item.getAttr...
{ "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_353
{ "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_return_application_found() throws Exception {\n final ApplicationImpl application = new ApplicationImpl(\"foobar\", \"1.0\", \"bazqux\");\n application.setId(3);\n given(applicationApi.searchApplications(any(SearchOptions.class))).willReturn(\n ...
{ "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_646
{ "fields": [ { "declarator": "identityAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private IdentityAPI identityAPI;", "type": "IdentityAPI", "var_name": "identityAPI" }, { "declarator": "userEngineClient", "modifier": "private", "o...
{ "body": "@Test(expected = APIException.class)\n public void update_throw_APIException_if_user_is_not_found_in_engine_repository() throws Exception {\n UserUpdater userUpdater = new UserUpdater();\n when(identityAPI.updateUser(1L, userUpdater)).thenThrow(new UserNotFoundException(\"aMessage\"));\n ...
{ "fields": [ { "declarator": "identityAPI", "modifier": "private", "original_string": "private IdentityAPI identityAPI;", "type": "IdentityAPI", "var_name": "identityAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/UserEngineClient.java", ...
{ "body": "public User update(long userId, UserUpdater userUpdater) {\n try {\n return identityAPI.updateUser(userId, userUpdater);\n } catch (UserNotFoundException e) {\n throw new APIException(new _(\"Can't update user. User not found\"), e);\n } catch (UpdateException 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_216
{ "fields": [ { "declarator": "request", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" }, { "declarator": "fileUploadServlet = new TenantFileUploadServlet()", "modifier": "@Spy...
{ "body": "@Test\n public void getExtension_should_return_an_empty_extension() throws IOException {\n // given\n final String filename = \"C:\\\\Users\\\\Desktop\\\\process\";\n\n // when\n final String extension = fileUploadServlet.getExtension(filename);\n\n // then\n as...
{ "fields": [ { "declarator": "serialVersionUID = -948661031179067420L", "modifier": "protected static final", "original_string": "protected static final long serialVersionUID = -948661031179067420L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "L...
{ "body": "protected String getExtension(final String fileName) {\n String extension = \"\";\n final String filenameLastSegment = getFilenameLastSegment(fileName);\n final int dotPos = filenameLastSegment.lastIndexOf('.');\n if (dotPos > -1) {\n extension = filenameLastSegment.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_86
{ "fields": [ { "declarator": "serverProperties = ServerProperties.getInstance()", "modifier": "", "original_string": "ServerProperties serverProperties = ServerProperties.getInstance();", "type": "ServerProperties", "var_name": "serverProperties" } ], "file": "common/src/tes...
{ "body": "@Test\n public void should_return_property_value() {\n assertThat(serverProperties.getValue(\"auth.UserLogger\")).isEqualTo(\"org.bonitasoft.console.common.server.login.credentials.UserLogger\");\n }", "class_method_signature": "ServerPropertiesTest.should_return_property_value()", "constr...
{ "fields": [ { "declarator": "FILENAME = \"server.properties\"", "modifier": "private static final", "original_string": "private static final String FILENAME = \"server.properties\";", "type": "String", "var_name": "FILENAME" }, { "declarator": "instance = null", ...
{ "body": "public String getValue(final String propertyName) {\n return serverProperties.getProperty(propertyName);\n }", "class_method_signature": "ServerProperties.getValue(final String propertyName)", "constructor": false, "full_signature": "public String getValue(final String propertyName)", "id...
{ "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_538
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private ArchivedCaseDocumentDatastore documentDatastore;", "type": "ArchivedCaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "...
{ "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.getArchivedProcessDocument(id.toLong())).thenThrow(new ArchivedDocumentNotFoundEx...
{ "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 ArchivedCaseDocumentItem get(final APIID id) {\n try {\n final ArchivedDocument documentItem = processAPI.getArchivedProcessDocument(id.toLong());\n return convertEngineToConsoleItem(documentItem);\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_492
{ "fields": [ { "declarator": "pageLister", "modifier": "private", "original_string": "private PageLister pageLister;", "type": "PageLister", "var_name": "pageLister" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/PageListerTest.java", "...
{ "body": "@Test\n public void getPages_return_all_available_bonita_pages() {\n\n final List<BonitaPageItem> pages = pageLister.getPages();\n\n assertThat(pages, equalTo(PageLister.pages));\n }", "class_method_signature": "PageListerTest.getPages_return_all_available_bonita_pages()", "construc...
{ "fields": [ { "declarator": "pages = new ArrayList<BonitaPageItem>()", "modifier": "protected final static", "original_string": "protected final static List<BonitaPageItem> pages = new ArrayList<BonitaPageItem>();", "type": "List<BonitaPageItem>", "var_name": "pages" } ], "...
{ "body": "public List<BonitaPageItem> getPages() {\n return pages;\n }", "class_method_signature": "PageLister.getPages()", "constructor": false, "full_signature": "public List<BonitaPageItem> getPages()", "identifier": "getPages", "invocations": [], "modifiers": "public", "parameters": "()",...
{ "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_168
{ "fields": [ { "declarator": "requestAccessor", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequestAccessor requestAccessor;", "type": "HttpServletRequestAccessor", "var_name": "requestAccessor" }, { "declarator": "tenantIdAccess...
{ "body": "@Test(expected = ServletException.class)\n public void testInvalidTenantIdThrowsException() throws Exception {\n doReturn(\"invalid\").when(requestAccessor).getTenantId();\n\n new TenantIdAccessor(requestAccessor).ensureTenantId();\n }", "class_method_signature": "TenantIdAccessorTest...
{ "fields": [ { "declarator": "request", "modifier": "private", "original_string": "private HttpServletRequestAccessor request;", "type": "HttpServletRequestAccessor", "var_name": "request" }, { "declarator": "portalCookies = new PortalCookies()", "modifier": "pri...
{ "body": "public long ensureTenantId() throws ServletException {\n long tenantId = parseTenantId(request.getTenantId());\n if(tenantId < 0) {\n return getDefaultTenantId();\n }\n return getRequestedTenantId();\n }", "class_method_signature": "TenantIdAccessor.ensureTenantI...
{ "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_187
{ "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 testDropPasswordOnRealUrl() throws Exception {\n final LoginServlet servlet = new LoginServlet();\n\n final String cleanUrl = servlet\n .dropPassword(\n \"?username=walter.bates&password=bpm&redirectUrl=http%3A%2F%2Flocalhost%3A8080%2Fbonita%2F...
{ "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_69
{ "fields": [ { "declarator": "securityProperties", "modifier": "@Mock\n private", "original_string": "@Mock\n private SecurityProperties securityProperties;", "type": "SecurityProperties", "var_name": "securityProperties" }, { "declarator": "platformManagementUti...
{ "body": "@Test\n public void should_reloadPropertiesIfInDebug_handles_exception() throws Exception {\n //given\n doReturn(true).when(securityProperties).isAPIAuthorizationsCheckInDebugMode();\n doThrow(IOException.class).when(platformManagementUtils).initializePlatformConfiguration();\n ...
{ "fields": [], "file": "common/src/main/java/org/bonitasoft/console/common/server/utils/PermissionsBuilderAccessor.java", "identifier": "PermissionsBuilderAccessor", "interfaces": "", "methods": [ { "class_method_signature": "PermissionsBuilderAccessor.createPermissionBuilder(final APISession sessi...
{ "body": "static void reloadPropertiesIfInDebug(SecurityProperties securityProperties, PlatformManagementUtils platformManagementUtils) throws LoginFailedException {\n if (securityProperties.isAPIAuthorizationsCheckInDebugMode()) {\n try {\n platformManagementUtils.initializePlatform...
{ "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_884
{ "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 intNumberIsParsedToInteger() throws Exception {\n\n int converted = converter.convert(\"456789\");\n\n assertEquals(456789, converted);\n }", "class_method_signature": "IntegerConverterTest.intNumberIsParsedToInteger()", "constructor": false, "full_signature": ...
{ "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_304
{ "fields": [ { "declarator": "hsRequest = new MockHttpServletRequest()", "modifier": "", "original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();", "type": "MockHttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse = ne...
{ "body": "@Test\n public void getResource_should_call_the_resource_renderer() throws Exception {\n hsRequest.setPathInfo(\"/custompage_htmlexample/css/file.css\");\n final File pageDir = new File(\"/pageDir\");\n final String pageName = \"custompage_htmlexample\";\n given(resourceRende...
{ "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_754
{ "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_null() throws Exception {\n // given:\n final BPMMessage bpmMessage = new BPMMessage();\n bpmMessage.setMessageName(\"msg\");\n bpmMessage.setTargetProcess(\"myProcess\");\n bpmMessage...
{ "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_241
{ "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_with_null_localDate_value_should_silently_return_null() throws Exception {\n // when:\n final Object nullLocalDate = new ContractTypeConverter(ISO_8601_DATE_PATTERNS).convertToType(Type.LOCALDATE, null);\n\n // then:\n assertThat(nullLocalDat...
{ "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_611
{ "fields": [ { "declarator": "TENANT_ID = 67534L", "modifier": "private static final", "original_string": "private static final long TENANT_ID = 67534L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "roleDatastore", "modifier": "@InjectMocks\n @...
{ "body": "@Test\n public void should_update_role_in_the_engine() throws Exception {\n RoleUpdater roleUpdater = new RoleUpdater().setName(\"newName\");\n doReturn(new RoleImpl(123, \"newName\")).when(identityAPI).updateRole(eq(123L), eq(roleUpdater));\n //when\n roleDatastore.update(AP...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/organization/RoleDatastore.java", "identifier": "RoleDatastore", "interfaces": "implements\n DatastoreHasGet<RoleItem>,\n DatastoreHasSearch<RoleItem>,\n DatastoreHasAdd<RoleItem>,\n DatastoreHasUp...
{ "body": "@Override\n public RoleItem update(final APIID id, final Map<String, String> attributes) {\n try {\n final RoleUpdater updater = new RoleUpdater();\n\n if (attributes.containsKey(RoleItem.ATTRIBUTE_NAME)) {\n updater.setName(attributes.get(RoleItem.ATTRIBUTE_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_484
{ "fields": [ { "declarator": "tenantAdminDatastore = null", "modifier": "private", "original_string": "private TenantAdminDatastore tenantAdminDatastore = null;", "type": "TenantAdminDatastore", "var_name": "tenantAdminDatastore" }, { "declarator": "tenantAdministratio...
{ "body": "@Test\n public void testUpdateAlreadyInAvailable() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(false);\n final APIID apiid = APIID.makeAPIID(1L);\n\n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.update(apiid,\n mapOf(Tenant...
{ "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_90
{ "fields": [ { "declarator": "webBonitaConstantsUtilsWithTenantId = new WebBonitaConstantsUtils(1L)", "modifier": "private", "original_string": "private WebBonitaConstantsUtils webBonitaConstantsUtilsWithTenantId = new WebBonitaConstantsUtils(1L);", "type": "WebBonitaConstantsUtils", ...
{ "body": "@Test\n public void testWeCanGetFormsWorkFolder() throws Exception {\n WebBonitaConstantsTenancyImpl constantsTenants = new WebBonitaConstantsTenancyImpl(1L);\n final File expected = new File(constantsTenants.getFormsTempFolderPath());\n\n final File folder = webBonitaConstantsUtils...
{ "fields": [ { "declarator": "tenantConstantsUtils = new HashMap<>()", "modifier": "private static", "original_string": "private static Map<Long, WebBonitaConstantsUtils> tenantConstantsUtils = new HashMap<>();", "type": "Map<Long, WebBonitaConstantsUtils>", "var_name": "tenantConst...
{ "body": "public File getFormsWorkFolder() {\n return getFolder(webBonitaConstants.getFormsTempFolderPath());\n }", "class_method_signature": "WebBonitaConstantsUtils.getFormsWorkFolder()", "constructor": false, "full_signature": "public File getFormsWorkFolder()", "identifier": "getFormsWorkFolder...
{ "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_892
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private BooleanConverter converter;", "type": "BooleanConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/Bo...
{ "body": "@Test\n public void nullIsConvertedToNull() throws Exception {\n\n Boolean converted = converter.convert(null);\n\n assertNull(converted);\n }", "class_method_signature": "BooleanConverterTest.nullIsConvertedToNull()", "constructor": false, "full_signature": "@Test public void nul...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/BooleanConverter.java", "identifier": "BooleanConverter", "interfaces": "implements Converter<Boolean>", "methods": [ { "class_method_signature": "BooleanConverter.convert(String toBeConverte...
{ "body": "@Override\n public Boolean convert(String toBeConverted) {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n return Boolean.valueOf(toBeConverted);\n }", "class_method_signature": "BooleanConverter.convert(String toBeConverted)", "const...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_191
{ "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 testProtectRedirectUrlShouldNotChangeURL() {\n assertEquals(\"mobile/#home\", urlProtecter.protectRedirectUrl(\"mobile/#home\"));\n assertEquals(\"/bonita/mobile/#login\", urlProtecter.protectRedirectUrl(\"/bonita/mobile/#login\"));\n assertEquals(\"/bonita/porta...
{ "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_742
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProfileEntryEngineClient client;", "type": "ProfileEntryEngineClient", "var_name": "client" }, { "declarator": "entry1", "modifier": "@Mock\n privat...
{ "body": "@Test\n public void should_not_return_a_token_if_the_page_from_the_profile_entry_is_null() throws Exception {\n given(entry1.getPage()).willReturn(null);\n given(entry2.getPage()).willReturn(\"token 2\");\n\n TokenProfileProvider provider = new TokenProfileProvider(Arrays.asList(\n ...
{ "fields": [ { "declarator": "tokens = new ArrayList<String>()", "modifier": "private", "original_string": "private List<String> tokens = new ArrayList<String>();", "type": "List<String>", "var_name": "tokens" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server...
{ "body": "@Override\n public List<String> getTokens() {\n return tokens;\n }", "class_method_signature": "TokenProfileProvider.getTokens()", "constructor": false, "full_signature": "@Override public List<String> getTokens()", "identifier": "getTokens", "invocations": [], "modifiers": "@Overr...
{ "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_312
{ "fields": [ { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest req;", "type": "HttpServletRequest", "var_name": "req" }, { "declarator": "res", "modifier": "@Mock\n private", "original_stri...
{ "body": "@Test\n public void getPathSegments_should_return_expected_token_list_if_no_slash() throws UnsupportedEncodingException {\n when(req.getPathInfo()).thenReturn(\"a\");\n\n final List<String> tokens = resourceRenderer.getPathSegments(\"a\");\n assertThat(tokens).hasSize(1).containsExa...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(ResourceRenderer.class.getName())", "modifier": "private final static", "original_string": "private final static Logger LOGGER = Logger.getLogger(ResourceRenderer.class.getName());", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "public List<String> getPathSegments(final String pathInfo) throws UnsupportedEncodingException {\n final List<String> segments = new ArrayList<>();\n if (pathInfo != null) {\n for (final String segment : pathInfo.split(\"/\")) {\n if (!segment.isEmpty()) {\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_607
{ "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 convertRoleId() throws Exception {\n String convert = converter.convert(UserItem.FILTER_ROLE_ID);\n\n assertEquals(UserSearchDescriptor.ROLE_ID, convert);\n }", "class_method_signature": "UserSearchAttributeConverterTest.convertRoleId()", "constructor": false, ...
{ "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_257
{ "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 should_add_tenant_parameter_from_cookie_if_not_in_request() throws Exception {\n request.removeAllParameters();\n request.setCookies(new Cookie(\"bonita.tenant\", \"123\"));\n String redirectUrl = \"%2Fportal%2Fhomepage\";\n\n String loginURL = standardLog...
{ "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_579
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "processCategoryDatastore", "modifier": "private", ...
{ "body": "@Test(expected = APIForbiddenException.class)\n public void addingTwiceSameCategoryOnProcessIsForbidden() throws Exception {\n ProcessCategoryItem processCategory = aProcessCategory().build();\n doThrow(new AlreadyExistsException(\"this thing already exists!\")).when(processAPI)\n ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/ProcessCategoryDatastore.java", "identifier": "ProcessCategoryDatastore", "interfaces": "implements\n DatastoreHasAdd<ProcessCategoryItem>,\n DatastoreHasDelete", "methods": [ { "class_me...
{ "body": "@Override\n public ProcessCategoryItem add(final ProcessCategoryItem item) {\n try {\n getProcessAPI().addCategoriesToProcess(item.getProcessId().toLong(),\n Arrays.asList(item.getCategoryId().toLong()));\n\n return item;\n } catch (AlreadyExistsExc...
{ "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_129
{ "fields": [ { "declarator": "chain", "modifier": "@Mock\n private", "original_string": "@Mock\n private FilterChain chain;", "type": "FilterChain", "var_name": "chain" }, { "declarator": "request", "modifier": "@Mock\n private", "original_string":...
{ "body": "@Test\n public void testFilter() throws Exception {\n when(httpRequest.getSession()).thenReturn(httpSession);\n doAnswer(new Answer<Object>() {\n\n @Override\n public Object answer(final InvocationOnMock invocation) throws Throwable {\n return null;\n ...
{ "fields": [ { "declarator": "AUTHENTICATION_FILTER_EXCLUDED_PAGES_PATTERN = \"^/(bonita/)?(portal/themeResource$)|(theme/)|(portal/scripts)|(portal/formsService)|(apps/.+/API/)|(portal/resource/.+/API/)\"", "modifier": "protected static final", "original_string": "protected static final String...
{ "body": "protected void doAuthenticationFiltering(final HttpServletRequestAccessor requestAccessor,\n final HttpServletResponse response,\n final TenantIdAccessor tenantIdAccessor,\n final FilterChain chain) throws ServletException, IOException {\n\n try {\n if (!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_28
{ "fields": [ { "declarator": "EXPRESSION_NAME = \"expressionName\"", "modifier": "private static final", "original_string": "private static final String EXPRESSION_NAME = \"expressionName\";", "type": "String", "var_name": "EXPRESSION_NAME" }, { "declarator": "TRANSIEN...
{ "body": "@Test\n public void getTransientDataContextWithoutExpression() throws Exception {\n // Given\n final List<TransientData> transientDataList = new ArrayList<>();\n final TransientData transientData = new TransientData();\n transientData.setName(TRANSIENT_DATA_NAME);\n tr...
{ "fields": [ { "declarator": "IE_ONLOAD = \"ieonload\"", "modifier": "private static final", "original_string": "private static final String IE_ONLOAD = \"ieonload\";", "type": "String", "var_name": "IE_ONLOAD" }, { "declarator": "SCRIPT_ELEMENT_NAME = \"script\"", ...
{ "body": "@Override\n public Map<String, Serializable> getTransientDataContext(final List<TransientData> transientData, final Locale userLocale, final Map<String, Object> context)\n throws FormNotFoundException, FormServiceProviderNotFoundException, ClassNotFoundException, SessionTimeoutException, File...
{ "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_596
{ "fields": [ { "declarator": "groupEngineClient", "modifier": "@Mock\n private", "original_string": "@Mock\n private GroupEngineClient groupEngineClient;", "type": "GroupEngineClient", "var_name": "groupEngineClient" }, { "declarator": "bonitaHomeFolderAccessor",...
{ "body": "@Test\n public void convert_dont_update_name_if_this_is_a_blank_value() throws Exception {\n String unexpectedName = \" \";\n HashMap<String, String> attribute = buildSimpleAttribute(GroupItem.ATTRIBUTE_NAME, unexpectedName);\n\n GroupUpdater updater = groupUpdaterConverter.convert(...
{ "fields": [ { "declarator": "groupEngineClient", "modifier": "private", "original_string": "private GroupEngineClient groupEngineClient;", "type": "GroupEngineClient", "var_name": "groupEngineClient" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastor...
{ "body": "public GroupUpdater convert(Map<String, String> attributes, long tenantId) {\n GroupUpdater updater = new GroupUpdater();\n if (attributes.containsKey(GroupItem.ATTRIBUTE_DESCRIPTION)) {\n updater.updateDescription(attributes.get(GroupItem.ATTRIBUTE_DESCRIPTION));\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_345
{ "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_ApplicationHomePage_return_valide_path() throws Exception {\n given(applicationApi.getApplicationHomePage(1L)).willReturn(new ApplicationPageImpl(1, 1, \"pageToken\"));\n\n assertThat(model.getApplicationHomePage()).isEqualTo(\"pageToken/\");\n }", "class_me...
{ "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 String getApplicationHomePage() throws ApplicationPageNotFoundException {\n return applicationApi.getApplicationHomePage(application.getId()).getToken() + \"/\";\n }", "class_method_signature": "ApplicationModel.getApplicationHomePage()", "constructor": false, "full_signature": "publ...
{ "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_715
{ "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 parseFilterShouldBuildMapEvenIfNoValueForParam() throws Exception {\n // given:\n final List<String> filters = new ArrayList<>(2);\n filters.add(\"nomatchingvalue=\");\n\n // when:\n final Map<String, String> parseFilters = new CommonResource().pars...
{ "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_200
{ "fields": [ { "declarator": "requestAccessor", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequestAccessor requestAccessor;", "type": "HttpServletRequestAccessor", "var_name": "requestAccessor" } ], "file": "server/src/test/java/org/bonitasoft/console/com...
{ "body": "@Test\n public void should_return_TenantIdAccessor() {\n \n assertThat(TenantIdAccessorFactory.getTenantIdAccessor(requestAccessor)).isInstanceOf(TenantIdAccessor.class);\n }", "class_method_signature": "TenantIdAccessorFactoryTest.should_return_TenantIdAccessor()", "constructor": f...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(TenantIdAccessorFactory.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(TenantIdAccessorFactory.class.getName());", "type": "Logger", "var_name": ...
{ "body": "@SuppressWarnings(\"unchecked\")\n public static TenantIdAccessor getTenantIdAccessor(HttpServletRequestAccessor requestAccessor) {\n ServerProperties serverProperties = ServerProperties.getInstance();\n String tenantIdAccessorClassName = serverProperties.getValue(TENANTIDACCESSOR_PROPERTY...
{ "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_650
{ "fields": [ { "declarator": "identityAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private IdentityAPI identityAPI;", "type": "IdentityAPI", "var_name": "identityAPI" }, { "declarator": "userEngineClient", "modifier": "private", "o...
{ "body": "@Test\n public void get_fetch_a_user_from_engine_repository() throws Exception {\n \n userEngineClient.get(1L);\n \n verify(identityAPI).getUser(1L);\n }", "class_method_signature": "UserEngineClientTest.get_fetch_a_user_from_engine_repository()", "constructor": false,...
{ "fields": [ { "declarator": "identityAPI", "modifier": "private", "original_string": "private IdentityAPI identityAPI;", "type": "IdentityAPI", "var_name": "identityAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/UserEngineClient.java", ...
{ "body": "public User get(long userId) {\n try {\n return identityAPI.getUser(userId);\n } catch (UserNotFoundException e) {\n throw new APIException(new _(\"User not found\"), e);\n }\n }", "class_method_signature": "UserEngineClient.get(long userId)", "constructor"...
{ "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_447
{ "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 update_with_no_homePageId_should_send_null() {\n\n //given\n final HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(ApplicationItem.ATTRIBUTE_HOME_PAGE_ID, \"-1\");\n\n //when\n final ApplicationUpdater updater = converte...
{ "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 ApplicationUpdater toApplicationUpdater(final Map<String, String> attributes) {\n final ApplicationUpdater applicationUpdater = getApplicationUpdater();\n\n if (attributes.containsKey(ApplicationItem.ATTRIBUTE_TOKEN)) {\n applicationUpdater.setToken(attributes.get(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_53
{ "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_add_given_file_to_theme_directory() throws Exception {\n final ThemeArchive themeArchive = new ThemeArchive(createStyleFiles(\"bonita.css\"));\n\n themeArchive.extract(themeDirectory).add(\"style.css\", \"body {}\".getBytes());\n\n assertThat(themeDirector...
{ "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_851
{ "fields": [ { "declarator": "caller", "modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private", "original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;", "type": "APIServletCall", "var_name": "caller" }, { "declarator": "h...
{ "body": "@Test\n public void should_retrieve_the_CustomUserInfo_for_a_given_user_id() throws Exception {\n given(engine.listCustomInformation(3L, 0, 2)).willReturn(Arrays.asList(\n new CustomUserInfo(3L, new EngineCustomUserInfoDefinition(5L), new CustomUserInfoValueImpl()),\n ...
{ "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_502
{ "fields": [ { "declarator": "profileEntryClient", "modifier": "@Mock", "original_string": "@Mock\n ProfileEntryEngineClient profileEntryClient;", "type": "ProfileEntryEngineClient", "var_name": "profileEntryClient" }, { "declarator": "searchProfileEntriesHelper", ...
{ "body": "@Test\n public void testWeCanSearchProfiles() throws Exception {\n SearchResult<ProfileEntry> aKnownSearchResult = \n SearchUtils.createEngineSearchResult(aKnownProfileEntry(), anotherKnownProfileEntry());\n List<ProfileEntryItem> expectedProfileEntryItems = new ProfileEntry...
{ "fields": [ { "declarator": "profileEntryClient", "modifier": "private", "original_string": "private ProfileEntryEngineClient profileEntryClient;", "type": "ProfileEntryEngineClient", "var_name": "profileEntryClient" } ], "file": "server/src/main/java/org/bonitasoft/web/res...
{ "body": "@Override\n public ItemSearchResult<ProfileEntryItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n SearchOptionsCreator options = makeSearchOptions(page, resultsByPage, search, orders, filters);\n SearchResult<ProfileEntry> profileEntri...
{ "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_152
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test\n public void test_staticCheck_unauthorized() throws Exception {\n final Set<String> userPermissions = new HashSet<String>(Arrays.asList(\"MyPermission\", \"AnOtherPermission\"));\n final List<String> resourcePermissions = Arrays.asList(\"CasePermission\", \"SecondPermission\");\n ...
{ "fields": [ { "declarator": "SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\"", "modifier": "public static final", "original_string": "public static final String SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\";", "type": "String", "var_name": "SCRIPT_TYPE_AUTHORIZATION_PREFIX" }, ...
{ "body": "protected boolean staticCheck(final APICallContext apiCallContext, final Set<String> permissionsOfUser,\n final Set<String> resourcePermissions, final String username) {\n for (final String resourcePermission : resourcePermissions) {\n if (permissionsOfUser.contains(resourcePer...
{ "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_781
{ "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 search_should_search_case_items_on_CaseDatastore() {\n final int page = 6;\n final int resultsByPage = 10;\n final String search = \"plop\";\n final String orders = CaseItem.ATTRIBUTE_END_DATE;\n final Map<String, String> filters = new HashMap...
{ "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 public ItemSearchResult<CaseItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n // Check that team manager and supervisor filters are not used together\n if (filters.containsKey(Case...
{ "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_294
{ "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_add_Custom_Page_permissions_to_CompoundPermissions() throws Exception {\n // Given\n final HashSet<String> customPagePermissions = new HashSet<>(Arrays.asList(\"Organization Visualization\", \"Organization Managment\"));\n\n // When\n customPageServ...
{ "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": "void addPermissionsToCompoundPermissions(final String pageName, final Set<String> customPagePermissions,\n final CompoundPermissionsMapping compoundPermissionsMapping,\n final ResourcesPermissionsMapping resourcesPermissionsMapping) throws IOException {\n customPagePermissions....
{ "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_410
{ "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 addStringFilterToSearchBuilder_should_do_nothing_when_filter_value_is_null() {\n // given:\n final String filterName = \"someFilterKey\";\n final Map<String, String> filters = new HashMap<String, String>(1);\n filters.put(filterName, null);\n final ...
{ "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 addStringFilterToSearchBuilder(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.g...
{ "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_105
{ "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 ensureProcessDefinitionId_with_processDefinitionId() throws Exception {\n assertEquals(42L, processFormService.ensureProcessDefinitionId(apiSession, 42L, -1L, -1L));\n }", "class_method_signature": "ProcessFormServiceTest.ensureProcessDefinitionId_with_processDefinitionId...
{ "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 long ensureProcessDefinitionId(final APISession apiSession, final long processDefinitionId, final long processInstanceId, final long taskInstanceId)\n throws ArchivedProcessInstanceNotFoundException, ActivityInstanceNotFoundException, BonitaException {\n if (processDefinitionId != ...
{ "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_555
{ "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_when_cannot_write_file_on_add() throws IOException {\n // Given\n final URL docUrl = getClass().getResource(\"/doc.jpg\");\n mockedDocumentItem.setAttribute(CaseDocumentItem.ATTRIBUTE_CASE_ID, 1l);\n mo...
{ "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_806
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock", "original_string": "@Mock\n ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "activityVariableResource", "modifier": "@Spy\n @InjectMocks\n private"...
{ "body": "@Test(expected = APIException.class)\n public void shouldDoGetWithNothingThowsAnApiException() throws DataNotFoundException {\n //when\n activityVariableResource.getTaskVariable();\n }", "class_method_signature": "ActivityVariableResourceTest.shouldDoGetWithNothingThowsAnApiException(...
{ "fields": [ { "declarator": "ACTIVITYDATA_ACTIVITY_ID = \"activityid\"", "modifier": "public static final", "original_string": "public static final String ACTIVITYDATA_ACTIVITY_ID = \"activityid\";", "type": "String", "var_name": "ACTIVITYDATA_ACTIVITY_ID" }, { "decla...
{ "body": "@Get(\"json\")\n public DataInstance getTaskVariable() {\n try {\n final String taskId = getAttribute(ACTIVITYDATA_ACTIVITY_ID);\n final String dataName = getAttribute(ACTIVITYDATA_DATA_NAME);\n return getTaskVariableInstance(dataName, Long.valueOf(taskId));\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_386
{ "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_ActivityVariableResource_for_ActivityVariableResourceFinder() {\n final ActivityVariableResourceFinder activityVariableResourceFinder = spy(new ActivityVariableResourceFinder());\n doReturn(processAPI).when(activityVariableResourceFinder).getProcessAPI(any...
{ "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_739
{ "fields": [ { "declarator": "file", "modifier": "@Mock\n private", "original_string": "@Mock\n private VersionFile file;", "type": "VersionFile", "var_name": "file" }, { "declarator": "stream", "modifier": "@Mock\n private", "original_string": "@M...
{ "body": "@Test\n public void should_read_version_stream_to_return_its_version() throws Exception {\n final InputStream stream = IOUtils.toInputStream(\"1.0.0\");\n given(file.getStream()).willReturn(stream);\n\n final BonitaVersion version = new BonitaVersion(file);\n\n assertThat(ver...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(BonitaVersion.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(BonitaVersion.class.getName());", "type": "Logger", "var_name": "LOGGER" }, { "dec...
{ "body": "public String getVersion() {\n if (metadata == null) {\n metadata = read(file.getStream());\n }\n if (metadata.size() > 0) {\n return metadata.get(0).trim();\n } else {\n return \"\";\n }\n }", "class_method_signature": "BonitaVersion...
{ "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_693
{ "fields": [ { "declarator": "businessDataModelResource", "modifier": "protected", "original_string": "protected BusinessDataModelResource businessDataModelResource;", "type": "BusinessDataModelResource", "var_name": "businessDataModelResource" }, { "declarator": "tena...
{ "body": "@Test\n public void should_throws_an_exception_when_cannot_write_file_on_add() throws Exception {\n final BusinessDataModelItem item = new BusinessDataModelItem();\n item.setFileUpload(\"../../../bdmFile.zip\");\n doThrow(new APIException(\"\")).when(bonitaHomeFolderAccessor).getCom...
{ "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_369
{ "fields": [ { "declarator": "hsRequest", "modifier": "@Mock", "original_string": "@Mock\n HttpServletRequest hsRequest;", "type": "HttpServletRequest", "var_name": "hsRequest" }, { "declarator": "hsResponse", "modifier": "@Mock", "original_string": "@Mo...
{ "body": "@Test\n public void should_send_error_500_on_BonitaHomeNotSetException() throws Exception {\n doThrow(new BonitaHomeNotSetException(\"error\")).when(router).route(eq(hsRequest), eq(hsResponse), eq(session), eq(pageRenderer), eq(resourceRenderer), any(BonitaHomeFolderAccessor.class));\n\n s...
{ "fields": [ { "declarator": "serialVersionUID = -3911437607969651000L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3911437607969651000L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "@Override\n protected void service(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse)\n throws ServletException, IOException {\n\n final APISession session = getSession(hsRequest);\n\n // Check if requested URL is missing final slash (necessary in order to...
{ "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_406
{ "fields": [ { "declarator": "factory", "modifier": "", "original_string": "BonitaRestAPIFactory factory;", "type": "BonitaRestAPIFactory", "var_name": "factory" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/BonitaRestAPIFactoryTest.java", "identifier":...
{ "body": "@Test\n public void should_provide_an_APICustomUserInfoValue_when_requesting_custom_user_info_value() throws Exception {\n assertTrue(factory.defineApis(\"customuserinfo\", \"value\") instanceof APICustomUserInfoValue);\n }", "class_method_signature": "BonitaRestAPIFactoryTest.should_provide...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(BonitaRestAPIFactory.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(BonitaRestAPIFactory.class.getName());", "type": "Logger", "var_name": "LOGGER" } ]...
{ "body": "@Override\n public API<? extends IItem> defineApis(final String apiToken, final String resourceToken) {\n \t\n if (\"identity\".equals(apiToken)) {\n if (\"user\".equals(resourceToken)) {\n return new APIUser();\n } else if (\"role\".equals(resourceToken)) ...
{ "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_12
{ "fields": [ { "declarator": "formServiceProviderImpl", "modifier": "@Spy", "original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;", "type": "FormServiceProviderImpl", "var_name": "formServiceProviderImpl" }, { "declarator": "workflowAPI", ...
{ "body": "@Test\n public void should_canUserViewActivityInstanceForm_return_true_for_involved_user() throws Exception {\n final String formId = \"formId\";\n final long userId = 2L;\n final long activityInstanceID = 3L;\n\n //given\n doReturn(1L).when(formWorkflowAPIImpl).getPro...
{ "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 void canUserViewActivityInstanceForm(final APISession session, final User user, final IFormWorkflowAPI workflowAPI,\n final long activityInstanceID, final String formId, final long userId,\n final Map<String, Object> context) throws BPMEngineException, InvalidSessionExceptio...
{ "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_810
{ "fields": [ { "declarator": "PROCESS_DEFINITION_ID = 2L", "modifier": "private static final", "original_string": "private static final long PROCESS_DEFINITION_ID = 2L;", "type": "long", "var_name": "PROCESS_DEFINITION_ID" }, { "declarator": "ID_PROCESS_DEFINITION = \"...
{ "body": "@Test\n public void should_contract_violation_exception_log_explanations_when_logger_is_info() throws Exception {\n // given\n final String message = \"contract violation !!!!\";\n final List<String> explanations = Arrays.asList(\"explanation1\", \"explanation2\");\n doThrow(...
{ "fields": [ { "declarator": "CASE_ID_ATTRIBUTE = \"caseId\"", "modifier": "private static final", "original_string": "private static final String CASE_ID_ATTRIBUTE = \"caseId\";", "type": "String", "var_name": "CASE_ID_ATTRIBUTE" }, { "declarator": "PROCESS_DEFINITION...
{ "body": "@Post(\"json\")\n public String instantiateProcess(final Map<String, Serializable> inputs) throws ProcessDefinitionNotFoundException, ProcessActivationException,\n ProcessExecutionException, FileNotFoundException {\n final String userId = getRequestParameter(USER_PARAM);\n final...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_543
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private ArchivedCaseDocumentDatastore documentDatastore;", "type": "ArchivedCaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "...
{ "body": "@Test\n public void it_should_delete_two_documents() throws DocumentNotFoundException, DocumentException {\n final List<APIID> docs = new ArrayList<>();\n docs.add(APIID.makeAPIID(mockedDocument.getId()));\n docs.add(APIID.makeAPIID(mockedDocument.getId()));\n\n // When\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 void delete(final List<APIID> ids) {\n if (ids != null) {\n\n try {\n for (final APIID id : ids) {\n processAPI.deleteContentOfArchivedDocument(id.toLong());\n }\n } catch (final DocumentNotFoundException e)...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_113
{ "fields": [ { "declarator": "processFormService", "modifier": "@Spy", "original_string": "@Spy\n ProcessFormService processFormService;", "type": "ProcessFormService", "var_name": "processFormService" }, { "declarator": "processAPI", "modifier": "@Mock", ...
{ "body": "@Test\n public void isAllowedToSeeTask_should_return_false() throws Exception {\n when(processAPI.isInvolvedInHumanTaskInstance(1L, 42L)).thenReturn(false);\n when(processAPI.getHumanTaskInstance(42L)).thenReturn(mock(HumanTaskInstance.class));\n\n final boolean isAllowedToSeeTask =...
{ "fields": [ { "declarator": "PROCESS_DEPLOY = \"process_deploy\"", "modifier": "protected static final", "original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";", "type": "String", "var_name": "PROCESS_DEPLOY" }, { "declarator": "LOGGER ...
{ "body": "public boolean isAllowedToSeeTask(final APISession apiSession, final long taskInstanceId, final long enforcedUserId,\n final boolean assignTask) throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n try {\n if (processAPI.isInvolvedInHuman...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_390
{ "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_BusinessDataReferenceResource_for_BusinessDataReferenceResourceFinder() {\n final BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = spy(new BusinessDataReferenceResourceFinder());\n doReturn(bdmAPI).when(businessDataReferenceResourc...
{ "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_685
{ "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": "@SuppressWarnings(\"unchecked\")\n @Test(expected = APIException.class)\n public void we_get_an_exception_if_process_fail_to_start_with_variables() throws Exception {\n when(processAPI.startProcess(anyLong(), anyMap())).thenThrow(new ProcessExecutionException(\"\"));\n\n caseEngineClien...
{ "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_902
{ "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(expected = UnsupportedOperationException.class)\n public void factoryThrowExceptionForUnsuportedConverter() throws Exception {\n factory.createConverter(Servlet.class.getName());\n }", "class_method_signature": "ConverterFactoryTest.factoryThrowExceptionForUnsuportedConverter()", "co...
{ "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_45
{ "fields": [], "file": "common/src/test/java/org/bonitasoft/console/common/server/login/credentials/UserLoggerFactoryTest.java", "identifier": "UserLoggerFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_return_UserLogger() {\n assertThat(UserLoggerFactory.getUserLogger()).isInstanceOf(UserLogger.class);\n }", "class_method_signature": "UserLoggerFactoryTest.should_return_UserLogger()", "constructor": false, "full_signature": "@Test public void should_return_Us...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(UserLoggerFactory.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(UserLoggerFactory.class.getName());", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "public static UserLogger getUserLogger() {\n ServerProperties serverProperties = ServerProperties.getInstance();\n String userLoggerClassName = serverProperties.getValue(USERLOGGER_PROPERTY_NAME);\n UserLogger userLogger;\n if (userLoggerClassName == null || userLoggerClassName....
{ "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_451
{ "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_name_on_convert_attribute_name() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_TOKEN);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescriptor.TOKEN);\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/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_144
{ "fields": [ { "declarator": "SESSION_CSRF_TOKEN = \"csrftoken\"", "modifier": "public static final", "original_string": "public static final String SESSION_CSRF_TOKEN = \"csrftoken\";", "type": "String", "var_name": "SESSION_CSRF_TOKEN" }, { "declarator": "request = n...
{ "body": "@Test\n public void should_set_401_status_when_csrf_request_header_is_not_set() throws Exception {\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isFalse();\n assertThat(response.getStatus()).isEqualTo(401);\n }", "class_method_signatur...
{ "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_514
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/member/ProfileMemberItemConverterTest.java", "identifier": "ProfileMemberItemConverterTest", "interfaces": "", "superclass": "extends APITestWithMock" }
{ "body": "@Test\n public void testProfileMemberItemConversion() {\n ProfileMemberItemConverter converter = new ProfileMemberItemConverter();\n ProfileMember profileMember = anEngineProfileMember().build();\n\n ProfileMemberItem item = converter.convert(profileMember);\n\n assertTrue(ar...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/member/ProfileMemberItemConverter.java", "identifier": "ProfileMemberItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ProfileMemberItemConverter.convert(ProfileMember profileMemb...
{ "body": "@Override\n public ProfileMemberItem convert(ProfileMember profileMember) {\n ProfileMemberItem item = new ProfileMemberItem();\n item.setId(profileMember.getId());\n item.setProfileId(profileMember.getProfileId());\n item.setUserId(profileMember.getUserId());\n item.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_847
{ "fields": [ { "declarator": "USER_ID = APIID.makeAPIID(123L)", "modifier": "public static final", "original_string": "public static final APIID USER_ID = APIID.makeAPIID(123L);", "type": "APIID", "var_name": "USER_ID" }, { "declarator": "userItem", "modifier": "...
{ "body": "@Test\n public void should_update_password_if_valid() throws Exception {\n apiUser.update(USER_ID, map(UserItem.ATTRIBUTE_PASSWORD, \"accepted password\"));\n\n verify(userDatastore).update(eq(USER_ID), eq(map(UserItem.ATTRIBUTE_PASSWORD, \"accepted password\")));\n }", "class_method_...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(APIUser.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(APIUser.class.getName());", "type": "Logger", "var_name": "LOGGER" } ], "file": "s...
{ "body": "@Override\n public UserItem update(final APIID id, final Map<String, String> item) {\n // Do not update password if not set\n MapUtil.removeIfBlank(item, UserItem.ATTRIBUTE_PASSWORD);\n if (item.get(UserItem.ATTRIBUTE_PASSWORD) != null) {\n checkPasswordRobustness(item.ge...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_797
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock", "original_string": "@Mock\n ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "restResource", "modifier": "private", "original_string": "private Time...
{ "body": "@Test\n public void searchTimerEventTriggersShouldCallEngine() throws Exception {\n // given:\n final SearchOptions searchOptions = mock(SearchOptions.class);\n doReturn(1L).when(restResource).getLongParameter(anyString(), anyBoolean());\n doReturn(1).when(restResource).getIn...
{ "fields": [ { "declarator": "ID_PARAM_NAME = \"id\"", "modifier": "public static final", "original_string": "public static final String ID_PARAM_NAME = \"id\";", "type": "String", "var_name": "ID_PARAM_NAME" }, { "declarator": "processAPI", "modifier": "private ...
{ "body": "@Get(\"json\")\n public void searchTimerEventTriggers() {\n try {\n final Long caseId = getLongParameter(\"caseId\", true);\n final SearchResult<TimerEventTriggerInstance> searchResult = processAPI.searchTimerEventTriggerInstances(caseId, buildSearchOptions());\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_282
{ "fields": [ { "declarator": "request", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest request;", "type": "HttpServletRequest", "var_name": "request" }, { "declarator": "response", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void check_should_authorize_valid_requests() throws Exception {\n String apiPath = \"/API/living/0\";\n when(request.getRequestDispatcher(apiPath)).thenReturn(requestDispatcher);\n\n CustomPageRequestModifier customPageRequestModifier = new CustomPageRequestModifier()...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(CustomPageRequestModifier.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(CustomPageRequestModifier.class.getName());", "type": "Logger", "var_name": "LOGGER"...
{ "body": "public void forwardIfRequestIsAuthorized(final HttpServletRequest request, final HttpServletResponse response, final String apiPathShouldStartWith, final String apiPath) throws IOException, ServletException {\n try {\n URI uri = new URI(apiPath);\n if (!uri.normalize().toString...
{ "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_778
{ "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 delete_should_delete_case_items_on_CaseDatastore() {\n // Given\n final List<APIID> ids = Arrays.asList(APIID.makeAPIID(78L));\n\n // When\n apiCase.delete(ids);\n\n // Then\n verify(caseDatastore).delete(ids);\n }", "class_method_...
{ "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 public void delete(final List<APIID> ids) {\n getCaseDatastore().delete(ids);\n }", "class_method_signature": "APICase.delete(final List<APIID> ids)", "constructor": false, "full_signature": "@Override public void delete(final List<APIID> ids)", "identifier": "delete", "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_328
{ "fields": [ { "declarator": "session", "modifier": "@Mock", "original_string": "@Mock\n APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "applicationAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n public void should_call_engine_export_with_the_good_id() throws Exception {\n\n spiedApplicationsExportServlet.exportResources(new long[] { 1 }, session);\n\n verify(applicationAPI, times(1)).exportApplications(new long[] { 1 });\n }", "class_method_signature": "ApplicationsEx...
{ "fields": [ { "declarator": "EXPORT_FILE_NAME = \"applicationDescriptorFile.xml\"", "modifier": "private static final", "original_string": "private static final String EXPORT_FILE_NAME = \"applicationDescriptorFile.xml\";", "type": "String", "var_name": "EXPORT_FILE_NAME" }, ...
{ "body": "@Override\n protected byte[] exportResources(final long[] ids, final APISession apiSession) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException, ExecutionException, ExportException {\n final ApplicationAPI applicationAPI = getApplicationAPI(apiSession);\n return a...
{ "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_796
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "finderFactory", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void should_getArchivedTaskIDParameter_throws_an_exception_when_archived_task_id_parameter_is_null() throws Exception {\n //given\n doReturn(null).when(archviedTaskContextResource).getAttribute(ArchivedUserTaskContextResource.ARCHIVED_TASK_ID);\n\n try {\n ...
{ "fields": [ { "declarator": "ARCHIVED_TASK_ID = \"archivedTaskId\"", "modifier": "static final", "original_string": "static final String ARCHIVED_TASK_ID = \"archivedTaskId\";", "type": "String", "var_name": "ARCHIVED_TASK_ID" }, { "declarator": "processAPI", "m...
{ "body": "protected long getArchivedTaskIdParameter() {\n final String taskId = getAttribute(ARCHIVED_TASK_ID);\n if (taskId == null) {\n throw new APIException(\"Attribute '\" + ARCHIVED_TASK_ID + \"' is mandatory in order to get the archived task context\");\n }\n return Long...
{ "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_283
{ "fields": [ { "declarator": "customPageAuthorizationsHelper", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CustomPageAuthorizationsHelper customPageAuthorizationsHelper;", "type": "CustomPageAuthorizationsHelper", "var_name": "customPageAuthorizationsHelper" ...
{ "body": "@Test\n public void should_authorize_page_when_appToken_not_null_and_page_authorized_in_application() throws Exception {\n given(applicationAPI.searchApplicationPages(any(SearchOptions.class)))\n .willReturn(new SearchResultImpl<>(1, Collections.<ApplicationPage>emptyList()));\n ...
{ "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" }