id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
11337147_189
{ "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 testProtectRedirectUrlShouldRemoveHTTPFromURL() {\n assertEquals(\"google\", urlProtecter.protectRedirectUrl(\"httpgoogle\"));\n }", "class_method_signature": "URLProtectorTest.testProtectRedirectUrlShouldRemoveHTTPFromURL()", "constructor": false, "full_signature": "...
{ "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_473
{ "fields": [ { "declarator": "DISPLAY_NAME = \"menu name\"", "modifier": "private static final", "original_string": "private static final String DISPLAY_NAME = \"menu name\";", "type": "String", "var_name": "DISPLAY_NAME" }, { "declarator": "APPLICATION_ID = 1L", ...
{ "body": "@Test\n public void update_with_no_pageId_should_send_null() {\n\n //given\n final HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(ApplicationMenuItem.ATTRIBUTE_APPLICATION_ID, \"-1\");\n\n //when\n final ApplicationMenuUpdater updater = co...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationmenu/ApplicationMenuItemConverter.java", "identifier": "ApplicationMenuItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ApplicationMenuItemConverter.toApplicationMenuItem(fina...
{ "body": "public ApplicationMenuUpdater toApplicationMenuUpdater(final Map<String, String> attributes) {\n final ApplicationMenuUpdater applicationMenuUpdater = new ApplicationMenuUpdater();\n\n if (attributes.containsKey(ApplicationMenuItem.ATTRIBUTE_APPLICATION_PAGE_ID)) {\n Long appPageId...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_865
{ "fields": [ { "declarator": "jacksonDeserializer", "modifier": "private", "original_string": "private JacksonDeserializer jacksonDeserializer;", "type": "JacksonDeserializer", "var_name": "jacksonDeserializer" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/serve...
{ "body": "@Test(expected = APIException.class)\n public void deserialize_throw_exception_if_json_is_non_well_formed() throws Exception {\n String nonWellFormedJson = \"someJsonNonWellFormedJson\";\n\n jacksonDeserializer.deserialize(nonWellFormedJson, String.class);\n }", "class_method_signatur...
{ "fields": [ { "declarator": "mapper = new ObjectMapper()", "modifier": "private", "original_string": "private ObjectMapper mapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework...
{ "body": "public <T> T deserialize(String json, Class<T> clazz) {\n return deserialize(json, mapper.getTypeFactory().constructType(clazz));\n }", "class_method_signature": "JacksonDeserializer.deserialize(String json, Class<T> clazz)", "constructor": false, "full_signature": "public T deserialize(Str...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_166
{ "fields": [ { "declarator": "TENANT_ID = 43882L", "modifier": "private static final", "original_string": "private static final long TENANT_ID = 43882L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "autoLoginConfiguration", "modifier": "private", ...
{ "body": "@Test\n public void should_retrieve_empty_credentials_when_cannot_read_configuration() throws Exception{\n when(configurationFilesManager.getTenantAutoLoginConfiguration(TENANT_ID)).thenReturn(null);\n\n AutoLoginCredentials autoLoginCredentials = autoLoginCredentialsFinder.getCredential(n...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(AutoLoginCredentialsFinder.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(AutoLoginCredentialsFinder.class.getName());", "type": "Logger", "var_n...
{ "body": "public AutoLoginCredentials getCredential(ProcessIdentifier processIdentifier, long tenantId){\n AutoLoginCredentials autoLoginCredentials = getAutoLoginCredentials(processIdentifier, tenantId);\n return autoLoginCredentials;\n }", "class_method_signature": "AutoLoginCredentialsFinder.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_536
{ "fields": [ { "declarator": "datastore", "modifier": "private", "original_string": "private ArchivedCaseDatastore datastore;", "type": "ArchivedCaseDatastore", "var_name": "datastore" }, { "declarator": "processAPI", "modifier": "@Mock\n private", "orig...
{ "body": "@Test(expected = APIException.class)\n public void should_throw_an_api_exception_when_deletion_exception_is_rised() throws DeletionException {\n //given\n doThrow(new DeletionException(\"exception!\")).when(processAPI).deleteArchivedProcessInstancesInAllStates(anyList());\n final Li...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/ArchivedCaseDatastore.java", "identifier": "ArchivedCaseDatastore", "interfaces": "implements DatastoreHasGet<ArchivedCaseItem>,\nDatastoreHasSearch<ArchivedCaseItem>, DatastoreHasDelete", "methods": [ { ...
{ "body": "@Override\n public void delete(final List<APIID> ids) {\n try {\n final ProcessAPI processAPI = getProcessApi();\n final List<Long> toDeleteIds = new ArrayList<Long>();\n for (final APIID apiId : ids) {\n final ArchivedProcessInstance archivedProces...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_88
{ "fields": [ { "declarator": "TENANT_ID = 543892L", "modifier": "private static final", "original_string": "private static final long TENANT_ID = 543892L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "MY_PROP_PROPERTIES = \"myProp.properties\"", "...
{ "body": "@Test\n public void getAlsoCustomAndInternalPropertiesFromFilename_should_merge_internal_properties_if_exist() throws Exception {\n // given:\n Map<String, Properties> propertiesMap = new HashMap<>(2);\n final Properties defaultProps = new Properties();\n defaultProps.put(\"d...
{ "fields": [ { "declarator": "INSTANCE = new ConfigurationFilesManager()", "modifier": "private static", "original_string": "private static ConfigurationFilesManager INSTANCE = new ConfigurationFilesManager();", "type": "ConfigurationFilesManager", "var_name": "INSTANCE" }, ...
{ "body": "Properties getAlsoCustomAndInternalPropertiesFromFilename(Map<String, Properties> propertiesByFilename, String propertiesFileName) {\n Properties properties = new Properties();\n if (propertiesByFilename != null) {\n if (propertiesByFilename.containsKey(propertiesFileName)) {\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_4
{ "fields": [], "file": "forms/forms-server/src/test/java/org/bonitasoft/forms/server/accessor/impl/util/FormCacheUtilTest.java", "identifier": "FormCacheUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStoreFormWidget() {\n final FormWidget widget1 = new FormWidget();\n widget1.setId(\"widget1\");\n final Date processDeploymentDate = new Date();\n final FormCacheUtil formCacheUtil = FormCacheUtilFactory.getTenantFormCacheUtil(1);\n formCacheUt...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(FormCacheUtil.class.getName())", "modifier": "private static", "original_string": "private static Logger LOGGER = Logger.getLogger(FormCacheUtil.class.getName());", "type": "Logger", "var_name": "LOGGER" }, { "dec...
{ "body": "public String storeFormWidget(final String formID, final String pageID, final String locale, final Date processDeployementDate, final FormWidget formWidget) {\n final String formWidgetCacheId = formID + pageID + formWidget.getId() + locale + getDateStr(processDeployementDate) + DOMAIN_KEY_CONNECTOR ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_424
{ "fields": [ { "declarator": "field = Mockito.mock(Field.class)", "modifier": "@Mock", "original_string": "@Mock\n Field field = Mockito.mock(Field.class);", "type": "Field", "var_name": "field" }, { "declarator": "value = Mockito.mock(Value.class)", "modifier...
{ "body": "@Test\n public void testFilterField() throws Exception {\n Mockito.doReturn(\"field\").when(field).toString();\n Filter<String> filter = new Filter<String>(field, value);\n\n Assert.assertEquals(\"field\", filter.getField());\n }", "class_method_signature": "FilterTest.testFilt...
{ "fields": [ { "declarator": "field", "modifier": "private", "original_string": "private Field field;", "type": "Field", "var_name": "field" }, { "declarator": "value", "modifier": "private", "original_string": "private Value<V> value;", "type": "Valu...
{ "body": "public String getField() {\n return field.toString();\n }", "class_method_signature": "Filter.getField()", "constructor": false, "full_signature": "public String getField()", "identifier": "getField", "invocations": [ "toString" ], "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_30
{ "fields": [ { "declarator": "session", "modifier": "@Mock\n private", "original_string": "@Mock\n private APISession session;", "type": "APISession", "var_name": "session" }, { "declarator": "locale = new Locale(\"en\")", "modifier": "private final", ...
{ "body": "@Test\n public void it_should_call_evaluateProcessInitialExpressions() throws Exception {\n // Given\n final long processDefinitionID = 1;\n final long activityInstanceID = -1;\n // When\n formWorkflowAPIImpl.getEvaluateConditionExpressions(session, actions, locale, co...
{ "fields": [ { "declarator": "FORM_ACTION_CONDITION = \"FormActionCondition_\"", "modifier": "private static final", "original_string": "private static final String FORM_ACTION_CONDITION = \"FormActionCondition_\";", "type": "String", "var_name": "FORM_ACTION_CONDITION" }, {...
{ "body": "protected Map<String, Serializable> getEvaluateConditionExpressions(final APISession session, final List<FormAction> actions, final Locale locale,\n final Map<String, Serializable> context, final long processDefinitionID, final long activityInstanceID,\n final IFormExpressionsAPI form...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_561
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CaseDatastoreTest.class)", "modifier": "", "original_string": "Logger logger = LoggerFactory.getLogger(CaseDatastoreTest.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "caseDatastore", ...
{ "body": "@Test\n public final void addCallerFilterToSearchBuilderIfNecessary_should_do_nothing_when_filter_on_any_caller() {\n // Given\n final Map<String, String> filters = Collections.singletonMap(CaseItem.FILTER_CALLER, \"any\");\n final SearchOptionsBuilder builder = new SearchOptionsBui...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/CaseDatastore.java", "identifier": "CaseDatastore", "interfaces": "implements DatastoreHasGet<CaseItem>, DatastoreHasSearch<CaseItem>,\nDatastoreHasDelete, DatastoreHasAdd<CaseItem>", "methods": [ { "cla...
{ "body": "void addCallerFilterToSearchBuilderIfNecessary(final Map<String, String> filters, final SearchOptionsBuilder builder) {\n /*\n * By default we add a caller filter of -1 to avoid having sub processes.\n * If caller is forced to any then we don't need to add the filter.\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_131
{ "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 testFilterWithExcludedURL() throws Exception {\n final String url = \"test\";\n when(httpRequest.getRequestURL()).thenReturn(new StringBuffer(url));\n doReturn(true).when(authenticationFilter).matchExcludePatterns(url);\n authenticationFilter.doFilter(http...
{ "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_832
{ "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_custom_user_info_sorted() throws Exception {\n given(engine.searchCustomUserInfoValues(any(SearchOptions.class))).willReturn(\n new SearchResultImpl<CustomUserInfoValue>(0, Collections.<CustomUserInfoValue> emptyList()));\n ArgumentCaptor<...
{ "fields": [ { "declarator": "engineClientCreator", "modifier": "private", "original_string": "private CustomUserInfoEngineClientCreator engineClientCreator;", "type": "CustomUserInfoEngineClientCreator", "var_name": "engineClientCreator" }, { "declarator": "converter ...
{ "body": "@Override\n public ItemSearchResult<CustomUserInfoItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n SearchResult<CustomUserInfoValue> result = getClient().searchCustomUserInfoValues(new SearchOptionsCreator(\n page,\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_218
{ "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_proper_extension_for_short_filename() throws IOException {\n // given\n final String filename = \"process.bar\";\n\n // when\n final String extension = fileUploadServlet.getExtension(filename);\n\n // then\n assertT...
{ "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_648
{ "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 create_create_a_user_in_engine_repository() throws Exception {\n UserCreator userCreator = new UserCreator(\"aName\", \"aPassword\");\n \n userEngineClient.create(userCreator);\n \n verify(identityAPI).createUser(userCreator);\n }", "class_meth...
{ "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 create(UserCreator creator) {\n try {\n return identityAPI.createUser(creator);\n } catch (AlreadyExistsException e) {\n throw new APIForbiddenException(new _(\"Can't create user. User '%userName%' already exists\",\n new Arg(\"userName\", ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_280
{ "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 redirect_with_trailing_slash_should_not_add_question_mark() throws Exception {\n when(request.getContextPath()).thenReturn(\"bonita/\");\n when(request.getServletPath()).thenReturn(\"apps/\");\n when(request.getPathInfo()).thenReturn(\"myapp/mypage\");\n w...
{ "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 redirectToValidPageUrl(final HttpServletRequest request, final HttpServletResponse response) throws IOException {\n final StringBuilder taskURLBuilder = new StringBuilder(request.getContextPath());\n taskURLBuilder.append(request.getServletPath())\n .append(request....
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_795
{ "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_return_a_context_of_type_SingleBusinessDataRef_for_a_given_archived_task_instance() throws Exception {\n //given\n final Map<String, Serializable> context = new HashMap<String, Serializable>();\n String engineResult = \"object returned by engine\";\n\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": "private Serializable getContextResultElement(Serializable executionContextElementValue) {\n return resourceHandler.getContextResultElement(executionContextElementValue);\n }", "class_method_signature": "ArchivedUserTaskContextResource.getContextResultElement(Serializable executionContextElement...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_845
{ "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_not_update_password_if_empty() throws Exception {\n apiUser.update(USER_ID, map(UserItem.ATTRIBUTE_PASSWORD, \"\"));\n\n verify(userDatastore).update(eq(USER_ID), eq(Collections.<String, String> emptyMap()));\n }", "class_method_signature": "APIUserTest.shou...
{ "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_146
{ "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_parameter_is_wrong() throws Exception {\n request.addParameter(\"CSRFToken\", \"notAValidToken\");\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isFalse();\n assertThat(resp...
{ "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_516
{ "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_name_on_convert_attribute_name() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationPageItem.ATTRIBUTE_TOKEN);\n\n //then\n assertThat(convertedValue).isEqualTo(Application...
{ "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_47
{ "fields": [ { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\n private HttpServletRequest req;", "type": "HttpServletRequest", "var_name": "req" }, { "declarator": "resourceLocationReader = new ResourceLocationReader()", "mod...
{ "body": "@Test\n public void should_not_use_infopath_if_location_param_is_defined() throws Exception {\n\n when(req.getParameter(\"location\")).thenReturn(\"bonita.css\");\n\n final String resourceLocation = resourceLocationReader.getResourceLocationFromRequest(req);\n\n verify(req, never())...
{ "fields": [ { "declarator": "LOCATION_PARAM = \"location\"", "modifier": "public final static", "original_string": "public final static String LOCATION_PARAM = \"location\";", "type": "String", "var_name": "LOCATION_PARAM" } ], "file": "common/src/main/java/org/bonitasoft/c...
{ "body": "public String getResourceLocationFromRequest(final HttpServletRequest request) {\n String fileName = request.getParameter(LOCATION_PARAM);\n if (fileName == null) {\n final String pathInfo = request.getPathInfo();\n if (pathInfo != null && pathInfo.startsWith(\"/\") && p...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_453
{ "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_version_on_convert_attribute_version() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_VERSION);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescriptor.V...
{ "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_900
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private ConverterFactory factory;", "type": "ConverterFactory", "var_name": "factory" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConverterFacto...
{ "body": "@Test\n public void factoryCreateAStringConverterForStringClassName() throws Exception {\n \n Converter<?> createConverter = factory.createConverter(String.class.getName());\n \n assertTrue(createConverter instanceof StringConverter);\n }", "class_method_signature": "Con...
{ "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_687
{ "fields": [ { "declarator": "businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder()", "modifier": "private", "original_string": "private BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder();", "type":...
{ "body": "@Test\n public void should_return_a_context_of_type_Simple_for_a_given_task_instance() throws Exception {\n //given\n SimpleBusinessDataReferenceImpl bizDataRef = new SimpleBusinessDataReferenceImpl(\"Ticket\", \"com.acme.object.Ticket\", 8L);\n\n //when\n Serializable contex...
{ "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 Serializable toClientObject(Serializable object) {\n return BusinessDataReferenceResource.toClient((BusinessDataReference) object);\n }", "class_method_signature": "BusinessDataReferenceResourceFinder.toClientObject(Serializable object)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_238
{ "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 getAdaptedContractDefinition_should_return_a_converter_contract() throws IOException {\n //given\n final ContractDefinitionImpl processContract = new ContractDefinitionImpl();\n final List<InputDefinition> inputDefinitions = new ArrayList<>();\n inputDefin...
{ "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 ContractDefinition getAdaptedContractDefinition(final ContractDefinition contract) {\n final List<ConstraintDefinition> constraints = contract.getConstraints();\n final List<InputDefinition> inputDefinitions = adaptContractInputList(contract.getInputs());\n final ContractDefinit...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_392
{ "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_BusinessDataReferencesResource_for_BusinessDataReferencesResourceFinder() {\n final BusinessDataReferencesResourceFinder businessDataReferencesResourceFinder = spy(new BusinessDataReferencesResourceFinder());\n doReturn(bdmAPI).when(businessDataReferencesR...
{ "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_668
{ "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 get_throw_APIException_if_group_is_not_found_in_engine_repository() throws Exception {\n when(groupAPI.getGroup(1L)).thenThrow(new GroupNotFoundException(new Exception()));\n \n groupEngineClient.get(1L);\n }", "class_method_si...
{ "fields": [ { "declarator": "groupAPI", "modifier": "private", "original_string": "private GroupAPI groupAPI;", "type": "GroupAPI", "var_name": "groupAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/GroupEngineClient.java", "identifier":...
{ "body": "public Group get(Long groupId) {\n try {\n return groupAPI.getGroup(groupId);\n } catch (GroupNotFoundException e) {\n throw new APIException(new _(\"Unable to find group %groupId%\", new Arg(\"groupId\", groupId)));\n }\n }", "class_method_signature": "Group...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_541
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private ArchivedCaseDocumentDatastore documentDatastore;", "type": "ArchivedCaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "...
{ "body": "@Test\n public void it_should_call_processAPI_searchDocuments_method() throws SearchException {\n // Given\n when(processAPI.searchArchivedDocuments(any(SearchOptions.class))).thenReturn(mockedEngineSearchResults);\n final Map<String, String> filters = new HashMap<>();\n filt...
{ "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<ArchivedCaseDocumentItem> 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(ArchivedCaseDocume...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_111
{ "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 getProcessDefinitionId_with_no_name_and_version() throws Exception {\n assertEquals(-1L, processFormService.getProcessDefinitionId(apiSession, null, null));\n }", "class_method_signature": "ProcessFormServiceTest.getProcessDefinitionId_with_no_name_and_version()", "cons...
{ "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 getProcessDefinitionId(final APISession apiSession, final String processName, final String processVersion)\n throws ProcessDefinitionNotFoundException, BonitaException {\n if (processName != null && processVersion != null) {\n try {\n return getProces...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_812
{ "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_getProcessDefinitionIdParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception {\n // given\n doReturn(null).when(processInstantiationResource).getAttribute(ProcessInstantiationResource.PROCESS_DEFINITION_ID);\n\n try {\n ...
{ "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": "protected long getProcessDefinitionIdParameter() {\n final String processDefinitionId = getAttribute(PROCESS_DEFINITION_ID);\n if (processDefinitionId == null) {\n throw new APIException(\"Attribute '\" + PROCESS_DEFINITION_ID + \"' is mandatory\");\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_404
{ "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_APICustomUserInfoDefinition_when_requesting_custom_user_info_definition() throws Exception {\n assertTrue(factory.defineApis(\"customuserinfo\", \"definition\") instanceof APICustomUserInfoDefinition);\n }", "class_method_signature": "BonitaRestAPIFactor...
{ "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_10
{ "fields": [ { "declarator": "formServiceProviderImpl", "modifier": "@Spy", "original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;", "type": "FormServiceProviderImpl", "var_name": "formServiceProviderImpl" }, { "declarator": "workflowAPI", ...
{ "body": "@Test\n public void should_canUserViewInstanceForm_return_true_for_involved_user() throws Exception {\n final String formId = \"formId\";\n final long userId = 2L;\n final long processInstanceId = 3L;\n\n //given\n doReturn(1L).when(formWorkflowAPIImpl).getProcessDefin...
{ "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 canUserViewInstanceForm(final APISession session, final User user, final IFormWorkflowAPI workflowAPI, final long processInstanceID,\n final String formId, final long userId,\n final Map<String, Object> context) throws InvalidSessionException, BPMEngineException, FormNo...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_691
{ "fields": [ { "declarator": "businessDataModelResource", "modifier": "protected", "original_string": "protected BusinessDataModelResource businessDataModelResource;", "type": "BusinessDataModelResource", "var_name": "businessDataModelResource" }, { "declarator": "tena...
{ "body": "@Test\n public void should_unistall_and_install_bdm() throws Exception {\n final File bdmFile = testBDMFile();\n byte[] bdmFileContent = getContent(bdmFile);\n final BusinessDataModelItem item = new BusinessDataModelItem();\n item.setFileUpload(bdmFile.getName());\n do...
{ "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_384
{ "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(expected = RuntimeException.class)\n public void should_throw_RuntimeException_for_a_not_supported_class() throws Exception {\n\n factory.create(NotSupportedResource.class);\n }", "class_method_signature": "FinderFactoryTest.should_throw_RuntimeException_for_a_not_supported_class()", ...
{ "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_804
{ "fields": [ { "declarator": "VALID_COMPLEX_POST_BODY = \"{\\\"aBoolean\\\":true, \\\"aString\\\":\\\"hello world\\\", \\\"a_complex_type\\\":{\\\"aNumber\\\":2, \\\"aBoolean\\\":false}}\"", "modifier": "private static final", "original_string": "private static final String VALID_COMPLEX_POST_B...
{ "body": "@Test\n public void should_getTaskIDParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception {\n //given\n doReturn(null).when(taskContractResource).getAttribute(UserTaskContractResource.TASK_ID);\n\n try {\n //when\n taskContractResource...
{ "fields": [ { "declarator": "TASK_ID = \"taskId\"", "modifier": "static final", "original_string": "static final String TASK_ID = \"taskId\";", "type": "String", "var_name": "TASK_ID" }, { "declarator": "processAPI", "modifier": "private final", "original_...
{ "body": "protected long getTaskIdParameter() {\n final String taskId = getAttribute(TASK_ID);\n if (taskId == null) {\n throw new APIException(\"Attribute '\" + TASK_ID + \"' is mandatory\");\n }\n return Long.parseLong(taskId);\n }", "class_method_signature": "UserTaskCo...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_107
{ "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 getTaskName_with_taskInstanceId_on_archived_instance() throws Exception {\n final ArchivedActivityInstance archivedActivityInstance = mock(ArchivedActivityInstance.class);\n when(archivedActivityInstance.getName()).thenReturn(\"myTask\");\n when(processAPI.getAct...
{ "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 String getTaskName(final APISession apiSession, final long taskInstanceId) throws ActivityInstanceNotFoundException, BonitaException {\n if (taskInstanceId != -1L) {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n try {\n final ActivityInstanc...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_557
{ "fields": [ { "declarator": "documentDatastore", "modifier": "private", "original_string": "private CaseDocumentDatastore documentDatastore;", "type": "CaseDocumentDatastore", "var_name": "documentDatastore" }, { "declarator": "constantsValue", "modifier": "@Moc...
{ "body": "@Test(expected = APIForbiddenException.class)\n public void it_throws_an_exception_updating_a_document_with_unauthorized_path() throws IOException {\n // Given\n final Map<String, String> attributes = new HashMap<>();\n attributes.put(CaseDocumentItem.ATTRIBUTE_UPLOAD_PATH, \"C:\\\\...
{ "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 update(final APIID id, final Map<String, String> attributes) {\n DocumentValue documentValue = null;\n\n try {\n final String urlPath;\n\n if (attributes.containsKey(CaseDocumentItem.ATTRIBUTE_UPLOAD_PATH) || attributes.containsKey(...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_412
{ "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_add_equals_filter_when_is_applicable() {\n // given:\n final String filterName = \"someFilterKey\";\n final String engineAttributeName = \"EngineNumericKey\";\n final String filterValue = \"174\";\n final Map<St...
{ "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_296
{ "fields": [ { "declarator": "webBonitaConstantsUtils", "modifier": "@Mock\n private", "original_string": "@Mock\n private WebBonitaConstantsUtils webBonitaConstantsUtils;", "type": "WebBonitaConstantsUtils", "var_name": "webBonitaConstantsUtils" }, { "declarator...
{ "body": "@Test\n public void should_throw_an_IllegalStateException_when_accessing_tmp_folder_before_resolving_libraries() throws Exception {\n final CustomPageDependenciesResolver resolver = newCustomPageDependenciesResolver(null);\n\n expectedException.expect(IllegalStateException.class);\n\n ...
{ "fields": [ { "declarator": "LIB_FOLDER_NAME = \"lib\"", "modifier": "private static final", "original_string": "private static final String LIB_FOLDER_NAME = \"lib\";", "type": "String", "var_name": "LIB_FOLDER_NAME" }, { "declarator": "PAGES_LIB_TMPDIR = new HashMap...
{ "body": "public File getTempFolder() {\n if (libTempFolder == null) {\n throw new IllegalStateException(\"Custom page dependencies must be resolved first.\");\n }\n return libTempFolder;\n }", "class_method_signature": "CustomPageDependenciesResolver.getTempFolder()", "constru...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_783
{ "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_when_team_manager_filter_is_used_without_supervisor_filter() {\n final int page = 6;\n final int resultsByPage = 10;\n final String search = \"plop\";\n final String orders = CaseItem.ATTRIBUTE_END_DAT...
{ "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_279
{ "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 redirect_with_trailing_slash_should_not_encode_parameter() throws Exception {\n when(request.getContextPath()).thenReturn(\"bonita/\");\n when(request.getServletPath()).thenReturn(\"apps/\");\n when(request.getPathInfo()).thenReturn(\"myapp/mypage\");\n wh...
{ "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 redirectToValidPageUrl(final HttpServletRequest request, final HttpServletResponse response) throws IOException {\n final StringBuilder taskURLBuilder = new StringBuilder(request.getContextPath());\n taskURLBuilder.append(request.getServletPath())\n .append(request....
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_629
{ "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_IsPageTokenValid_returns_false_when_url_token_contains_non_alphanumeric_values() {\n assertThat(pageDatastore.isPageTokenValid(PageDatastore.PAGE_TOKEN_PREFIX + \"suffixxx_dsqds\")).isFalse();\n }", "class_method_signature": "PageDatastoreTest.should_IsPageTokenVal...
{ "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 boolean isPageTokenValid(final String urlToken) {\n return urlToken.matches(PAGE_TOKEN_PREFIX + \"\\\\p{Alnum}+\");\n }", "class_method_signature": "PageDatastore.isPageTokenValid(final String urlToken)", "constructor": false, "full_signature": "protected boolean isPageTokenValid(...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_500
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntryItemConverterTest.java", "identifier": "ProfileEntryItemConverterTest", "interfaces": "", "superclass": "extends APITestWithMock" }
{ "body": "@Test\n public void testWeCanConverteAProfileEntry() throws Exception {\n ProfileEntry profileEntry = anEngineProfileEntry().withCustomName(\"customName\").build();\n\n ProfileEntryItem item = new ProfileEntryItemConverter().convert(profileEntry);\n\n assertTrue(areEquals(aProfileEn...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntryItemConverter.java", "identifier": "ProfileEntryItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ProfileEntryItemConverter.convert(ProfileEntry profileEntry)", ...
{ "body": "@Override\n public ProfileEntryItem convert(ProfileEntry profileEntry) {\n ProfileEntryItem item = new ProfileEntryItem();\n item.setId(profileEntry.getId());\n item.setName(profileEntry.getName());\n item.setProfileId(profileEntry.getProfileId());\n item.setIndex(prof...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_150
{ "fields": [ { "declarator": "resourcesPermissionsMapping", "modifier": "@Mock\n private", "original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;", "type": "ResourcesPermissionsMapping", "var_name": "resourcesPermissionsMapping" }, ...
{ "body": "@Test\n public void should_checkPermissions_parse_the_request() throws Exception {\n doReturn(\"API/bpm/case/15\").when(request).getPathInfo();\n final RestAPIAuthorizationFilter restAPIAuthorizationFilterSpy = spy(restAPIAuthorizationFilter);\n doReturn(true).when(restAPIAuthorizat...
{ "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 checkPermissions(final HttpServletRequest request) throws ServletException {\n final RestRequestParser restRequestParser = new RestRequestParser(request).invoke();\n return checkPermissions(request, restRequestParser.getApiName(), restRequestParser.getResourceName(), restReq...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_853
{ "fields": [ { "declarator": "caller", "modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private", "original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;", "type": "APIServletCall", "var_name": "caller" }, { "declarator": "h...
{ "body": "@Test(expected = APIException.class)\n public void should_fail_when_passing_an_order_to_the_search() {\n api.search(0, 2, null, \"NAME ASC\", Collections.singletonMap(\"userId\", \"3\")).getResults();\n }", "class_method_signature": "APICustomUserInfoUserTest.should_fail_when_passing_an_orde...
{ "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_445
{ "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 toApplicationCreator_should_map_all_fields() throws Exception {\n //given\n final ApplicationItem item = new ApplicationItem();\n item.setToken(TOKEN);\n item.setDisplayName(DISPLAY_NAME);\n item.setVersion(VERSION);\n item.setDescription(DES...
{ "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 ApplicationCreator toApplicationCreator(final ApplicationItem appItem) {\n final ApplicationCreator creator = new ApplicationCreator(appItem.getToken(), appItem.getDisplayName(), appItem.getVersion());\n creator.setDescription(appItem.getDescription());\n creator.setProfileId(ap...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_51
{ "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(expected = LessCompilationException.class)\n public void should_throw_LessCompilationException_when_fail_to_compile_input_file() throws Exception {\n final File lessStyle = directory.newFile(\"style.less\");\n FileUtils.writeStringToFile(lessStyle, \"not compilable content\");\n ...
{ "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_202
{ "fields": [ { "declarator": "request = new MockHttpServletRequest()", "modifier": "private", "original_string": "private MockHttpServletRequest request = new MockHttpServletRequest();", "type": "MockHttpServletRequest", "var_name": "request" }, { "declarator": "portal...
{ "body": "@Test\n public void should_get_cookie_by_name_from_request() throws Exception {\n Cookie cookie = new Cookie(\"bonita.tenant\", \"123\");\n request.setCookies(cookie);\n\n Cookie fetchedCookie = portalCookies.getCookie(request, \"bonita.tenant\");\n\n assertThat(fetchedCookie...
{ "fields": [ { "declarator": "TENANT_COOKIE_NAME = \"bonita.tenant\"", "modifier": "private static final", "original_string": "private static final String TENANT_COOKIE_NAME = \"bonita.tenant\";", "type": "String", "var_name": "TENANT_COOKIE_NAME" } ], "file": "server/src/ma...
{ "body": "public Cookie getCookie(HttpServletRequest request, String name) {\n Cookie[] cookies = request.getCookies();\n if (cookies != null) {\n for (Cookie cookie : cookies) {\n if (cookie.getName().equals(name)) {\n return cookie;\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_652
{ "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 delete_delete_users_in_engine_repository() throws Exception {\n List<Long> idsToBeDeleted = asList(1L, 2L);\n \n userEngineClient.delete(idsToBeDeleted);\n \n verify(identityAPI).deleteUsers(idsToBeDeleted);\n }", "class_method_signature": "Use...
{ "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 void delete(List<Long> userIds) {\n try {\n identityAPI.deleteUsers(userIds);\n } catch (DeletionException e) {\n throw new APIException(new _(\"Error when deleting users\"), e);\n }\n }", "class_method_signature": "UserEngineClient.delete(List<Long> u...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_347
{ "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_getApplicationThemeName_return_valide_name() throws Exception {\n given(page.getName()).willReturn(\"themePage\");\n given(pageApi.getPage(2L)).willReturn(page);\n\n String appLayoutName = model.getApplicationThemeName();\n\n assertThat(appLayoutNam...
{ "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 getApplicationThemeName() throws PageNotFoundException {\n return pageApi.getPage(application.getThemeId()).getName();\n }", "class_method_signature": "ApplicationModel.getApplicationThemeName()", "constructor": false, "full_signature": "public String getApplicationThemeName()...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_717
{ "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 getParametersAsList_should_support_values_with_slash() throws Exception {\n //given\n final CommonResource resource = spy(new CommonResource());\n final Form form = new Form(\"f=a%3Db&f=c%3D%2Fd%2Fd%2Ce\");\n given(resource.getQuery()).willReturn(form);\n\...
{ "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": "public List<String> getParameterAsList(final String name) {\n return Arrays.asList(getQuery().getValuesArray(name));\n }", "class_method_signature": "CommonResource.getParameterAsList(final String name)", "constructor": false, "full_signature": "public List<String> getParameterAsList(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_594
{ "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_return_a_groupUpdater_with_required_fields() throws Exception {\n HashMap<String, String> attributes = new HashMap<>();\n attributes.put(GroupItem.ATTRIBUTE_DESCRIPTION, \"aNewDescription\");\n attributes.put(GroupItem.ATTRIBUTE_ICON, \"aNewIcon\");\n ...
{ "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_828
{ "fields": [ { "declarator": "converter = new CustomUserInfoConverter()", "modifier": "private", "original_string": "private CustomUserInfoConverter converter = new CustomUserInfoConverter();", "type": "CustomUserInfoConverter", "var_name": "converter" } ], "file": "server/s...
{ "body": "@Test\n public void should_return_a_fully_configured_definition() throws Exception {\n CustomUserInfoDefinition dummy = new EngineCustomUserInfoDefinition(1L, \"foo\", \"bar\");\n\n CustomUserInfoDefinitionItem definition = converter.convert(dummy);\n\n assertThat(definition.getAttr...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/organization/CustomUserInfoConverter.java", "identifier": "CustomUserInfoConverter", "interfaces": "", "methods": [ { "class_method_signature": "CustomUserInfoConverter.convert(CustomUserInfoDefinition definition)", ...
{ "body": "public CustomUserInfoDefinitionItem convert(CustomUserInfoDefinition definition) {\n CustomUserInfoDefinitionItem item = new CustomUserInfoDefinitionItem();\n item.setId(APIID.makeAPIID(definition.getId()));\n item.setName(definition.getName());\n item.setDescription(definition....
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_605
{ "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 convertGroupId() throws Exception {\n String convert = converter.convert(UserItem.FILTER_GROUP_ID);\n\n assertEquals(UserSearchDescriptor.GROUP_ID, convert);\n }", "class_method_signature": "UserSearchAttributeConverterTest.convertGroupId()", "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_255
{ "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 testGetLoginpageURLFromMobile() throws Exception {\n String redirectUrl = \"%2Fmobile%2F\";\n request.setServletPath(\"/mobile/#login\");\n\n String loginURL = standardLoginManagerImpl.getLoginPageURL(requestAccessor, redirectUrl);\n\n assertThat(loginURL)...
{ "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_740
{ "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_trim_extra_new_line_character() throws Exception {\n final InputStream stream = IOUtils.toInputStream(\"1.0.0\\n\");\n given(file.getStream()).willReturn(stream);\n\n final BonitaVersion version = new BonitaVersion(file);\n\n assertThat(version.getV...
{ "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_310
{ "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() throws UnsupportedEncodingException {\n when(req.getPathInfo()).thenReturn(\"a/b\");\n\n final List<String> tokens = resourceRenderer.getPathSegments(\"a/b\");\n assertThat(tokens).hasSize(2).containsExactly(\"a...
{ "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_193
{ "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 testProtectRedirectUrlIsNotChangedIfStartingWithBonitaPortal() {\n assertEquals(\"portal/homepage#?_p=caselistinguser&test=http://www.google.fr\",\n urlProtecter.protectRedirectUrl(\"portal/homepage#?_p=caselistinguser&test=http://www.google.fr\"));\n }", "...
{ "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_469
{ "fields": [ { "declarator": "DISPLAY_NAME = \"menu name\"", "modifier": "private static final", "original_string": "private static final String DISPLAY_NAME = \"menu name\";", "type": "String", "var_name": "DISPLAY_NAME" }, { "declarator": "APPLICATION_ID = 1L", ...
{ "body": "@Test\n public void applicationMenuItem_with_null_parent_id_should_not_return_null() throws Exception {\n //given\n final ApplicationMenuImpl applicationMenu = new ApplicationMenuImpl(DISPLAY_NAME, APPLICATION_ID, APPLICATION_PAGE_ID, INDEX);\n applicationMenu.setParentId(null);\n ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationmenu/ApplicationMenuItemConverter.java", "identifier": "ApplicationMenuItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ApplicationMenuItemConverter.toApplicationMenuItem(fina...
{ "body": "public ApplicationMenuItem toApplicationMenuItem(final ApplicationMenu applicationMenu) {\n final ApplicationMenuItem item = new ApplicationMenuItem();\n item.setId(applicationMenu.getId());\n item.setApplicationId(applicationMenu.getApplicationId());\n item.setDisplayName(appli...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_890
{ "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 trueIsConvertedToTrue() throws Exception {\n\n Boolean converted = converter.convert(\"true\");\n\n assertTrue(converted);\n }", "class_method_signature": "BooleanConverterTest.trueIsConvertedToTrue()", "constructor": false, "full_signature": "@Test public void...
{ "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_486
{ "fields": [ { "declarator": "tenantAdminDatastore = null", "modifier": "private", "original_string": "private TenantAdminDatastore tenantAdminDatastore = null;", "type": "TenantAdminDatastore", "var_name": "tenantAdminDatastore" }, { "declarator": "tenantAdministratio...
{ "body": "@Test\n public void testUpdateGoInAvailable() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(true);\n final APIID apiid = APIID.makeAPIID(1L);\n\n \n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.update(apiid,\n mapOf(Ten...
{ "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_92
{ "fields": [ { "declarator": "fakeI18n", "modifier": "private", "original_string": "private FakeI18n fakeI18n;", "type": "FakeI18n", "var_name": "fakeI18n" } ], "file": "common/src/test/java/org/bonitasoft/web/toolkit/client/common/exception/http/JsonExceptionSerializerTest....
{ "body": "@Test\n public void testWeCanConvertExceptionWithMessageToJson() throws Exception {\n HttpException exception = new HttpException(\"message\");\n JsonExceptionSerializer serializer = new JsonExceptionSerializer(exception);\n\n String json = serializer.end();\n\n assertEquals(...
{ "fields": [ { "declarator": "json", "modifier": "private", "original_string": "private StringBuilder json;", "type": "StringBuilder", "var_name": "json" } ], "file": "common/src/main/java/org/bonitasoft/web/toolkit/client/common/exception/http/JsonExceptionSerializer.java",...
{ "body": "public String end() {\n return json.append(\"}\").toString();\n }", "class_method_signature": "JsonExceptionSerializer.end()", "constructor": false, "full_signature": "public String end()", "identifier": "end", "invocations": [ "toString", "append" ], "modifiers": "public", ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_243
{ "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_String_value_should_silently_return_null() throws Exception {\n // when:\n final Object nullString = new ContractTypeConverter(ISO_8601_DATE_PATTERNS).convertToType(Type.TEXT, null);\n\n // then:\n assertThat(nullString).isNull();\n...
{ "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_613
{ "fields": [ { "declarator": "customPageContentValidator", "modifier": "private", "original_string": "private CustomPageContentValidator customPageContentValidator;", "type": "CustomPageContentValidator", "var_name": "customPageContentValidator" }, { "declarator": "exp...
{ "body": "@Test\n public void zip_with_index_in_resources_should_be_valid() throws Exception {\n final File zipFileResource = new File(getClass().getResource(\"/pageWithIndexInResources.zip\").toURI());\n UnzipUtil.unzip(zipFileResource, new File(\"target\" + File.separator + \"pageWithIndexInResour...
{ "fields": [ { "declarator": "INDEX_GROOVY = \"Index.groovy\"", "modifier": "private static final", "original_string": "private static final String INDEX_GROOVY = \"Index.groovy\";", "type": "String", "var_name": "INDEX_GROOVY" }, { "declarator": "INDEX_HTML = \"index....
{ "body": "public void validate(File pageFolder) throws InvalidPageZipContentException {\n final File[] rootFiles = pageFolder.listFiles();\n if (rootFiles == null) {\n throw new InvalidPageZipContentException(\n \"Content not found.\");\n }\n Properties pageP...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_306
{ "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 renderFile_should_build_a_valid_response() throws BonitaException, URISyntaxException, IOException, IllegalAccessException,\n InstantiationException {\n final File resourceFile = getResourceFile();\n final long contentLength = resourceFile.length();\n ...
{ "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 void renderFile(final HttpServletRequest request, final HttpServletResponse response, final File resourceFile, final APISession apiSession)\n throws CompilationFailedException, IllegalAccessException, IOException, BonitaException {\n\n byte[] content;\n response.setCharacter...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_756
{ "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_accept_primitive_types_in_correlation_values() throws Exception {\n // given:\n final BPMMessage bpmMessage = new BPMMessage();\n bpmMessage.setMessageName(\"msg\");\n bpmMessage.setTargetProcess(\"myProcess\");\n bpmMessage.setTa...
{ "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_886
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private DoubleConverter converter;", "type": "DoubleConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/Doub...
{ "body": "@Test\n public void nullIsConvertedToNull() throws Exception {\n\n Double converted = converter.convert(null);\n\n assertNull(converted);\n }", "class_method_signature": "DoubleConverterTest.nullIsConvertedToNull()", "constructor": false, "full_signature": "@Test public void nullI...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/DoubleConverter.java", "identifier": "DoubleConverter", "interfaces": "implements Converter<Double>", "methods": [ { "class_method_signature": "DoubleConverter.convert(String toBeConverted)",...
{ "body": "@Override\n public Double convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Double.parseDouble(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_185
{ "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 testPasswordIsDroppedEvenIfQueryMarkUpIsntThere() throws Exception {\n final LoginServlet servlet = new LoginServlet();\n\n final String cleanQueryString = servlet.dropPassword(\"password=bpm#dhash1&dhash2\");\n\n assertThat(cleanQueryString, is(\"#dhash1&dhash2\...
{ "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_84
{ "fields": [ { "declarator": "TENANT_ID = 12L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 12L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "COMPOUND_PERMISSIONS_MAPPING_FILE = \"compound.properties\"", ...
{ "body": "@Test\n public void should_getProperty_return_the_right_permissions_list() throws Exception {\n\n final ConfigurationFile tenantProperties = new ConfigurationFile(COMPOUND_PERMISSIONS_MAPPING_FILE, TENANT_ID);\n\n final Set<String> compoundPermissionsList = tenantProperties.getPropertyAsSe...
{ "fields": [ { "declarator": "propertiesFilename", "modifier": "private final", "original_string": "private final String propertiesFilename;", "type": "String", "var_name": "propertiesFilename" }, { "declarator": "tenantId", "modifier": "private final", "or...
{ "body": "public Set<String> getPropertyAsSet(final String propertyName) {\n final String propertyAsString = getProperty(propertyName);\n return stringToSet(propertyAsString);\n }", "class_method_signature": "ConfigurationFile.getPropertyAsSet(final String propertyName)", "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_490
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileFilterCreatorTest.java", "identifier": "ProfileFilterCreatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_create_a_filter_for_profiles_with_navigation() {\n ProfileFilterCreator profileFilterCreator = new ProfileFilterCreator(new ProfileSearchDescriptorConverter());\n\n Filter<? extends Serializable> filter = profileFilterCreator.create(ProfileItem.FILTER_HAS_NAVIGAT...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileFilterCreator.java", "identifier": "ProfileFilterCreator", "interfaces": "", "methods": [ { "class_method_signature": "ProfileFilterCreator.ProfileFilterCreator(AttributeConverter fieldConverter)", ...
{ "body": "@Override\n public Filter<? extends Serializable> create(String attribute, String value) {\n if (ProfileItem.FILTER_HAS_NAVIGATION.equals(attribute)) {\n return Boolean.valueOf(value)\n ? new Filter<String>(new Field(attribute, fieldConverter), null, Operator.DIFFERE...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_869
{ "fields": [ { "declarator": "jacksonDeserializer", "modifier": "private", "original_string": "private JacksonDeserializer jacksonDeserializer;", "type": "JacksonDeserializer", "var_name": "jacksonDeserializer" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/serve...
{ "body": "@Test(expected = APIException.class)\n public void deserializeList_throw_exception_if_json_is_not_a_list() throws Exception {\n String json = \"{\\\"address\\\":{\\\"street\\\":\\\"310 La Gouterie\\\",\\\"city\\\":\\\"Charnecles\\\"},\\\"id\\\":1,\\\"firstName\\\":\\\"Colin\\\",\\\"lastName\\\":\...
{ "fields": [ { "declarator": "mapper = new ObjectMapper()", "modifier": "private", "original_string": "private ObjectMapper mapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework...
{ "body": "public <T> List<T> deserializeList(String json, Class<T> clazz) {\n return deserialize(json , mapper.getTypeFactory().constructCollectionType(List.class, clazz));\n }", "class_method_signature": "JacksonDeserializer.deserializeList(String json, Class<T> clazz)", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_644
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "activityEngineClient", "modifier": "private", "or...
{ "body": "@Test(expected = APIException.class)\n public void getDataInstance_throw_exception_if_data_is_not_found() throws Exception {\n when(processAPI.getActivityDataInstance(anyString(), anyLong())).thenThrow(new DataNotFoundException(new NullPointerException()));\n \n activityEngineClient...
{ "fields": [ { "declarator": "processAPI", "modifier": "private", "original_string": "private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/ActivityEngineClient.java", ...
{ "body": "public DataInstance getDataInstance(String dataName, long activityId) {\n try {\n return processAPI.getActivityDataInstance(dataName, activityId);\n } catch (DataNotFoundException e) {\n throw new APIException(new _(\"Unable to find data instance %dataName% for activity ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_214
{ "fields": [ { "declarator": "tempFolder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "tempFolder" }, { "declarator": "fileU...
{ "body": "@Test\n public void should_set_413_status_code_with_json_body_when_file_is_too_big_and_json_is_supported() throws Exception {\n final ServletFileUpload serviceFileUpload = mock(ServletFileUpload.class);\n final HttpServletResponse response = mock(HttpServletResponse.class);\n final ...
{ "fields": [ { "declarator": "serialVersionUID = 58370675886169565L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 58370675886169565L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "server/src/main/java/...
{ "body": "@Override\n protected void defineUploadDirectoryPath(final HttpServletRequest request) {\n final long tenantId = getAPISession(request).getTenantId();\n setUploadDirectoryPath(WebBonitaConstantsUtils.getInstance(tenantId).getTempFolder().getPath());\n }", "class_method_signature": "Te...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_701
{ "fields": [ { "declarator": "bdmAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataRef...
{ "body": "@Test\n public void should_return_a_not_found_status() throws Exception {\n when(bdmAPI.getProcessBusinessDataReference(\"myEmployee\", 486L)).thenThrow(new DataNotFoundException(new Exception(\"message\")));\n\n final Response response = request(\"/bdm/businessDataReference/486/myEmployee...
{ "fields": [ { "declarator": "bdmAPI", "modifier": "private final", "original_string": "private final BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceReso...
{ "body": "@Get(\"json\")\n public BusinessDataReferenceClient getProcessBusinessDataReference() throws DataNotFoundException {\n final String businessDataName = getPathParam(\"dataName\");\n final Long processInstanceId = getPathParamAsLong(\"caseId\");\n return toClient(bdmAPI.getProcessBusi...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_351
{ "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(expected = CreationException.class)\n public void should_throw_create_error_exception_when_search_fail() throws Exception {\n given(applicationApi.searchApplications(any(SearchOptions.class))).willThrow(SearchException.class);\n\n factory.createApplicationModel(\"foo\");\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_582
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "processConnectorDatastore", "modifier": "private", ...
{ "body": "@Test(expected = APIException.class)\n public void getThrowExceptionIfProcessDefinitionIsNotFound() throws Exception {\n when(this.processAPI.getConnectorImplementation(anyLong(), anyString(), anyString()))\n .thenThrow(new ConnectorNotFoundException(null));\n\n this.process...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/ProcessConnectorDatastore.java", "identifier": "ProcessConnectorDatastore", "interfaces": "implements\n DatastoreHasGet<ProcessConnectorItem>,\n DatastoreHasSearch<ProcessConnectorItem>", "methods"...
{ "body": "@Override\n public ProcessConnectorItem get(final APIID id) {\n try {\n\n final ProcessConnectorItem connector =\n convertEngineToConsoleItem(\n getProcessAPI().getConnectorImplementation(\n id.getPartAsLong(ATTRIBUTE_PRO...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_428
{ "fields": [ { "declarator": "filterCreator", "modifier": "@Mock", "original_string": "@Mock\n FilterCreator filterCreator;", "type": "FilterCreator", "var_name": "filterCreator" }, { "declarator": "longFilter", "modifier": "@Mock", "original_string": "@...
{ "body": "@Test\n public void testFilterListWithMultiTypeFilterCreator() throws Exception {\n Map<String, String> map = aMapWith(new Arg(\"field1\", \"value\"),\n new Arg(\"field2\", \"value\"));\n\n doReturn(longFilter).when(filterCreator).create(eq(\"field1\"), anyString());\n ...
{ "fields": [ { "declarator": "filters = new ArrayList<Filter<?>>()", "modifier": "private final", "original_string": "private final List<Filter<?>> filters = new ArrayList<Filter<?>>();", "type": "List<Filter<?>>", "var_name": "filters" } ], "file": "server/src/main/java/org...
{ "body": "public List<Filter<?>> asList() {\n return filters;\n }", "class_method_signature": "Filters.asList()", "constructor": false, "full_signature": "public List<Filter<?>> asList()", "identifier": "asList", "invocations": [], "modifiers": "public", "parameters": "()", "return": "List<...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_8
{ "fields": [ { "declarator": "formServiceProviderImpl", "modifier": "@Spy", "original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;", "type": "FormServiceProviderImpl", "var_name": "formServiceProviderImpl" }, { "declarator": "workflowAPI", ...
{ "body": "@Test\n public void testextractProcessDefinitionUUID() throws Exception {\n\n //given\n final String formId = \"processName--1.0$entry\";\n\n //when\n final String extractProcessDefinitionUUID = formServiceProviderImpl.extractProcessDefinitionUUID(formId);\n\n //then\n...
{ "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 String extractProcessDefinitionUUID(final String formId) {\n final StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"\\\\\");\n stringBuilder.append(FormServiceProviderUtil.FORM_ID_SEPARATOR);\n final String processDefinitionUUID;\n fin...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_583
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "processConnectorDatastore", "modifier": "private", ...
{ "body": "@Test(expected = APIException.class)\n public void searchThrowExceptionIfProcessDefinitionIsNotFound() throws Exception {\n when(this.processAPI.getConnectorImplementations(anyLong(), anyInt(), anyInt(), any(ConnectorCriterion.class)))\n .thenThrow(new NullPointerException());\n\n ...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/ProcessConnectorDatastore.java", "identifier": "ProcessConnectorDatastore", "interfaces": "implements\n DatastoreHasGet<ProcessConnectorItem>,\n DatastoreHasSearch<ProcessConnectorItem>", "methods"...
{ "body": "@Override\n public ItemSearchResult<ProcessConnectorItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n try {\n final Long processId = MapUtil.getValueAsLong(filters, ATTRIBUTE_PROCESS_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_429
{ "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_value_as_String_by_default() {\n GenericFilterCreator creator = new GenericFilterCreator(new AttributeConverter() {\n\n @Override\n public String convert(String attribute) {\n return attribute;\n }\n\n...
{ "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_9
{ "fields": [ { "declarator": "formServiceProviderImpl", "modifier": "@Spy", "original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;", "type": "FormServiceProviderImpl", "var_name": "formServiceProviderImpl" }, { "declarator": "workflowAPI", ...
{ "body": "@Test\n public void testextractProcessDefinitionUUID_with_step_name() throws Exception {\n //given\n final String formId = \"processName--1.0--Step1$entry\";\n\n //when\n final String extractProcessDefinitionUUID = formServiceProviderImpl.extractProcessDefinitionUUID(formId);...
{ "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 String extractProcessDefinitionUUID(final String formId) {\n final StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"\\\\\");\n stringBuilder.append(FormServiceProviderUtil.FORM_ID_SEPARATOR);\n final String processDefinitionUUID;\n fin...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_645
{ "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 update_update_a_user_in_engine_repository() throws Exception {\n UserUpdater userUpdater = new UserUpdater();\n \n userEngineClient.update(1L, userUpdater);\n \n verify(identityAPI).updateUser(1L, userUpdater);\n }", "class_method_signature": "...
{ "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_215
{ "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_proper_extension() throws IOException {\n // given\n final String filename = \"C:\\\\Users\\\\Desktop\\\\process.bar\";\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_700
{ "fields": [ { "declarator": "bdmAPI", "modifier": "@Mock\n private", "original_string": "@Mock\n private BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataRef...
{ "body": "@Test\n public void should_return_the_multi_reference_of_the_business_data_of_the_process_instance() throws Exception {\n final MultipleBusinessDataReference reference= buildMultipleEmployeeReference(\"myEmployee\", 487467354L, 48674634L);\n when(bdmAPI.getProcessBusinessDataReference(\"my...
{ "fields": [ { "declarator": "bdmAPI", "modifier": "private final", "original_string": "private final BusinessDataAPI bdmAPI;", "type": "BusinessDataAPI", "var_name": "bdmAPI" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceReso...
{ "body": "@Get(\"json\")\n public BusinessDataReferenceClient getProcessBusinessDataReference() throws DataNotFoundException {\n final String businessDataName = getPathParam(\"dataName\");\n final Long processInstanceId = getPathParamAsLong(\"caseId\");\n return toClient(bdmAPI.getProcessBusi...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_350
{ "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_check_that_application_has_a_profile_mapped_to_it() throws Exception {\n application.setProfileId(1L);\n assertThat(model.hasProfileMapped()).isEqualTo(true);\n \n application.setProfileId(null);\n assertThat(model.hasProfileMapped()).isEqual...
{ "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 hasProfileMapped() {\n return application.getProfileId() != null;\n }", "class_method_signature": "ApplicationModel.hasProfileMapped()", "constructor": false, "full_signature": "public boolean hasProfileMapped()", "identifier": "hasProfileMapped", "invocations": [ "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_887
{ "fields": [ { "declarator": "converter", "modifier": "private", "original_string": "private DoubleConverter converter;", "type": "DoubleConverter", "var_name": "converter" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/Doub...
{ "body": "@Test\n public void emptyIsConvertedToNull() throws Exception {\n\n Double converted = converter.convert(\"\");\n\n assertNull(converted);\n }", "class_method_signature": "DoubleConverterTest.emptyIsConvertedToNull()", "constructor": false, "full_signature": "@Test public void emp...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/DoubleConverter.java", "identifier": "DoubleConverter", "interfaces": "implements Converter<Double>", "methods": [ { "class_method_signature": "DoubleConverter.convert(String toBeConverted)",...
{ "body": "@Override\n public Double convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Double.parseDouble(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_184
{ "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 testUrlStayTheSameIfNoPasswordArePresent() throws Exception {\n final LoginServlet servlet = new LoginServlet();\n\n final String cleanQueryString = servlet.dropPassword(\"?param=value#dhash\");\n\n assertThat(cleanQueryString, is(\"?param=value#dhash\"));\n }...
{ "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_85
{ "fields": [ { "declarator": "TENANT_ID = 12L", "modifier": "public static final", "original_string": "public static final long TENANT_ID = 12L;", "type": "long", "var_name": "TENANT_ID" }, { "declarator": "COMPOUND_PERMISSIONS_MAPPING_FILE = \"compound.properties\"", ...
{ "body": "@Test\n public void should_getProperty_return_the_right_permissions_list_with_single_value() throws Exception {\n\n final ConfigurationFile tenantProperties = new ConfigurationFile(COMPOUND_PERMISSIONS_MAPPING_FILE, TENANT_ID);\n\n final Set<String> compoundPermissionsList = tenantProperti...
{ "fields": [ { "declarator": "propertiesFilename", "modifier": "private final", "original_string": "private final String propertiesFilename;", "type": "String", "var_name": "propertiesFilename" }, { "declarator": "tenantId", "modifier": "private final", "or...
{ "body": "public Set<String> getPropertyAsSet(final String propertyName) {\n final String propertyAsString = getProperty(propertyName);\n return stringToSet(propertyAsString);\n }", "class_method_signature": "ConfigurationFile.getPropertyAsSet(final String propertyName)", "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_491
{ "fields": [], "file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileFilterCreatorTest.java", "identifier": "ProfileFilterCreatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void should_create_a_filter_for_profiles_without_navigation() {\n ProfileFilterCreator profileFilterCreator = new ProfileFilterCreator(new ProfileSearchDescriptorConverter());\n\n Filter<? extends Serializable> filter = profileFilterCreator.create(ProfileItem.FILTER_HAS_NAVI...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/ProfileFilterCreator.java", "identifier": "ProfileFilterCreator", "interfaces": "", "methods": [ { "class_method_signature": "ProfileFilterCreator.ProfileFilterCreator(AttributeConverter fieldConverter)", ...
{ "body": "@Override\n public Filter<? extends Serializable> create(String attribute, String value) {\n if (ProfileItem.FILTER_HAS_NAVIGATION.equals(attribute)) {\n return Boolean.valueOf(value)\n ? new Filter<String>(new Field(attribute, fieldConverter), null, Operator.DIFFERE...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_868
{ "fields": [ { "declarator": "jacksonDeserializer", "modifier": "private", "original_string": "private JacksonDeserializer jacksonDeserializer;", "type": "JacksonDeserializer", "var_name": "jacksonDeserializer" } ], "file": "server/src/test/java/org/bonitasoft/web/rest/serve...
{ "body": "@Test\n public void deserialize_can_deserialize_complex_types() throws Exception {\n User expectedUser = new User(1, \"Colin\", \"Puy\", new Date(428558400000L), new Address(\"310 La Gouterie\", \"Charnecles\"));\n String json = \"{\\\"address\\\":{\\\"street\\\":\\\"310 La Gouterie\\\",\\...
{ "fields": [ { "declarator": "mapper = new ObjectMapper()", "modifier": "private", "original_string": "private ObjectMapper mapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "server/src/main/java/org/bonitasoft/web/rest/server/framework...
{ "body": "public <T> T deserialize(String json, Class<T> clazz) {\n return deserialize(json, mapper.getTypeFactory().constructType(clazz));\n }", "class_method_signature": "JacksonDeserializer.deserialize(String json, Class<T> clazz)", "constructor": false, "full_signature": "public T deserialize(Str...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_242
{ "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_localDateTime_value_should_silently_return_null() throws Exception {\n // when:\n final Object nullLocalDateTime = new ContractTypeConverter(ISO_8601_DATE_PATTERNS).convertToType(Type.LOCALDATETIME, null);\n\n // then:\n assertThat(...
{ "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_612
{ "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 add_role_without_icon_should_create_role_without_retrieving_icon_from_filesystem() throws Exception {\n doReturn(new RoleImpl(123, \"name\")).when(identityAPI).createRole(any(RoleCreator.class));\n RoleItem roleItem = new RoleItem();\n roleItem.setIcon(\"\");\n ...
{ "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 add(final RoleItem role) {\n try {\n final RoleCreator creator = new RoleCreator(role.getName());\n\n if (!StringUtil.isBlank(role.getDisplayName())) {\n creator.setDisplayName(role.getDisplayName());\n }\n if ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_307
{ "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(expected = BonitaException.class)\n public void renderFile_should_throw_bonita_exception_on_ioexception() throws BonitaException, URISyntaxException, IOException, IllegalAccessException,\n InstantiationException {\n final File resourceFile = getResourceFile();\n doThrow(ne...
{ "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 void renderFile(final HttpServletRequest request, final HttpServletResponse response, final File resourceFile, final APISession apiSession)\n throws CompilationFailedException, IllegalAccessException, IOException, BonitaException {\n\n byte[] content;\n response.setCharacter...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_757
{ "fields": [ { "declarator": "processAPI", "modifier": "@Mock", "original_string": "@Mock\n ProcessAPI processAPI;", "type": "ProcessAPI", "var_name": "processAPI" }, { "declarator": "restResource", "modifier": "private", "original_string": "private BPMM...
{ "body": "@Test\n public void sendMessage_should_throw_exception_if_messageContent_has_unsupported_value_type() throws Exception {\n // given:\n final BPMMessage bpmMessage = new BPMMessage();\n bpmMessage.setMessageName(\"msg\");\n bpmMessage.setTargetProcess(\"myProcess\");\n ...
{ "fields": [ { "declarator": "SUPPORTED_TYPES = new HashSet<>()", "modifier": "private static final", "original_string": "private static final Set<String> SUPPORTED_TYPES = new HashSet<>();", "type": "Set<String>", "var_name": "SUPPORTED_TYPES" }, { "declarator": "proc...
{ "body": "@Post(\"json\")\n public void sendMessage(BPMMessage message) {\n validateMandatoryAttributes(message);\n try {\n Map<Expression, Expression> msgContent = new HashMap<>();\n if (message.getMessageContent() != null) {\n for (Map.Entry<String, BPMMessageV...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_192
{ "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 testProtectRedirectUrlRedirectingtoCaseListingUser() {\n assertEquals(\"#?_p=caselistinguser\", urlProtecter.protectRedirectUrl(\"#?_p=caselistinguser\"));\n }", "class_method_signature": "URLProtectorTest.testProtectRedirectUrlRedirectingtoCaseListingUser()", "construc...
{ "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_468
{ "fields": [ { "declarator": "DISPLAY_NAME = \"menu name\"", "modifier": "private static final", "original_string": "private static final String DISPLAY_NAME = \"menu name\";", "type": "String", "var_name": "DISPLAY_NAME" }, { "declarator": "APPLICATION_ID = 1L", ...
{ "body": "@Test\n public void toApplicationMenuItem_should_map_all_fields() throws Exception {\n //given\n final ApplicationMenuImpl applicationMenu = new ApplicationMenuImpl(DISPLAY_NAME, APPLICATION_ID, APPLICATION_PAGE_ID, INDEX);\n applicationMenu.setParentId(PARENT_MENU_ID);\n app...
{ "fields": [], "file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationmenu/ApplicationMenuItemConverter.java", "identifier": "ApplicationMenuItemConverter", "interfaces": "", "methods": [ { "class_method_signature": "ApplicationMenuItemConverter.toApplicationMenuItem(fina...
{ "body": "public ApplicationMenuItem toApplicationMenuItem(final ApplicationMenu applicationMenu) {\n final ApplicationMenuItem item = new ApplicationMenuItem();\n item.setId(applicationMenu.getId());\n item.setApplicationId(applicationMenu.getApplicationId());\n item.setDisplayName(appli...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_891
{ "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 falseIsConvertedToFalse() throws Exception {\n\n Boolean converted = converter.convert(\"false\");\n\n assertFalse(converted);\n }", "class_method_signature": "BooleanConverterTest.falseIsConvertedToFalse()", "constructor": false, "full_signature": "@Test publi...
{ "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_487
{ "fields": [ { "declarator": "tenantAdminDatastore = null", "modifier": "private", "original_string": "private TenantAdminDatastore tenantAdminDatastore = null;", "type": "TenantAdminDatastore", "var_name": "tenantAdminDatastore" }, { "declarator": "tenantAdministratio...
{ "body": "@Test\n public void testGetTenantAvailable() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(false);\n final APIID apiid = APIID.makeAPIID(1L);\n\n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.get(apiid);\n\n verify(tenantAdministratio...
{ "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_93
{ "fields": [ { "declarator": "fakeI18n", "modifier": "private", "original_string": "private FakeI18n fakeI18n;", "type": "FakeI18n", "var_name": "fakeI18n" } ], "file": "common/src/test/java/org/bonitasoft/web/toolkit/client/common/exception/http/JsonExceptionSerializerTest....
{ "body": "@Test\n public void testJsonContainsInternationalizedMessageWhenLocalIsSet() throws Exception {\n APIException exception = new APIException(new _(\"message\"));\n fakeI18n.setL10n(\"localization\");\n exception.setLocale(LOCALE.en);\n JsonExceptionSerializer serializer = new ...
{ "fields": [ { "declarator": "json", "modifier": "private", "original_string": "private StringBuilder json;", "type": "StringBuilder", "var_name": "json" } ], "file": "common/src/main/java/org/bonitasoft/web/toolkit/client/common/exception/http/JsonExceptionSerializer.java",...
{ "body": "public String end() {\n return json.append(\"}\").toString();\n }", "class_method_signature": "JsonExceptionSerializer.end()", "constructor": false, "full_signature": "public String end()", "identifier": "end", "invocations": [ "toString", "append" ], "modifiers": "public", ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_604
{ "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 convertUserName() throws Exception {\n String convert = converter.convert(UserItem.ATTRIBUTE_USERNAME);\n\n assertEquals(UserSearchDescriptor.USER_NAME, convert);\n }", "class_method_signature": "UserSearchAttributeConverterTest.convertUserName()", "constructor":...
{ "fields": [ { "declarator": "mapping = new HashMap<>()", "modifier": "protected static", "original_string": "protected static Map<String, String> mapping = new HashMap<>();", "type": "Map<String, String>", "var_name": "mapping" }, { "declarator": "valueTypeMapping = n...
{ "body": "@Override\n public String convert(final String attribute) {\n return mapping.get(attribute);\n }", "class_method_signature": "UserSearchAttributeConverter.convert(final String attribute)", "constructor": false, "full_signature": "@Override public String convert(final String attribute)", ...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }
11337147_254
{ "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 testGetLoginpageURLFromPortal() throws Exception {\n String redirectUrl = \"%2Fportal%2Fhomepage\";\n request.setServletPath(\"/portal/\");\n\n String loginURL = standardLoginManagerImpl.getLoginPageURL(requestAccessor, redirectUrl);\n\n assertThat(loginUR...
{ "fields": [ { "declarator": "LOGGER = Logger.getLogger(StandardAuthenticationManagerImpl.class.getName())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = Logger.getLogger(StandardAuthenticationManagerImpl.class.getName());", "type": "Logger"...
{ "body": "@Override\n public String getLoginPageURL(final HttpServletRequestAccessor request, final String redirectURL) throws ServletException {\n final StringBuilder url = new StringBuilder();\n String context = request.asHttpServletRequest().getContextPath();\n final String servletPath = r...
{ "created": null, "fork": null, "fork_count": 45, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 11337147, "size": 98566, "stargazer_count": 19, "stars": null, "updates": null, "url": "https://github.com/bonitasoft/bonita-web" }