id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
11337147_779 | {
"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 add_should_add_case_item_on_CaseDatastore() {\n // Given\n final CaseItem item = mock(CaseItem.class);\n doReturn(item).when(caseDatastore).add(item);\n\n // When\n final CaseItem result = apiCase.add(item);\n\n // Then\n assertE... | {
"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 CaseItem add(final CaseItem caseItem) {\n return getCaseDatastore().add(caseItem);\n }",
"class_method_signature": "APICase.add(final CaseItem caseItem)",
"constructor": false,
"full_signature": "@Override public CaseItem add(final CaseItem caseItem)",
"identifier": ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_329 | {
"fields": [
{
"declarator": "session",
"modifier": "@Mock",
"original_string": "@Mock\n APISession session;",
"type": "APISession",
"var_name": "session"
},
{
"declarator": "applicationAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n ... | {
"body": "@Test\n public void should_logger_log_with_name_of_the_Servlet() throws Exception {\n assertThat(spiedApplicationsExportServlet.getLogger().getName()).isEqualTo(\"org.bonitasoft.console.server.servlet.ApplicationsExportServlet\");\n }",
"class_method_signature": "ApplicationsExportServletTes... | {
"fields": [
{
"declarator": "EXPORT_FILE_NAME = \"applicationDescriptorFile.xml\"",
"modifier": "private static final",
"original_string": "private static final String EXPORT_FILE_NAME = \"applicationDescriptorFile.xml\";",
"type": "String",
"var_name": "EXPORT_FILE_NAME"
},
... | {
"body": "@Override\n protected Logger getLogger() {\n return LOGGER;\n }",
"class_method_signature": "ApplicationsExportServlet.getLogger()",
"constructor": false,
"full_signature": "@Override protected Logger getLogger()",
"identifier": "getLogger",
"invocations": [],
"modifiers": "@Overri... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_903 | {
"fields": [
{
"declarator": "converter",
"modifier": "private",
"original_string": "private TypeConverter converter;",
"type": "TypeConverter",
"var_name": "converter"
},
{
"declarator": "factory",
"modifier": "@Mock\n private",
"original_string": "@Moc... | {
"body": "@Test\n @SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n public void convertCreateAFactoryAndConvertStringValueToSerializableObject() throws Exception {\n Converter typedConverter = mock(Converter.class);\n when(factory.createConverter(anyString())).thenReturn(typedConverter);\n\n ... | {
"fields": [
{
"declarator": "factory",
"modifier": "private",
"original_string": "private ConverterFactory factory;",
"type": "ConverterFactory",
"var_name": "factory"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/TypeConverter.... | {
"body": "public Serializable convert(String className, String convert) throws ConversionException {\n return factory.createConverter(className).convert(convert);\n }",
"class_method_signature": "TypeConverter.convert(String className, String convert)",
"constructor": false,
"full_signature": "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_44 | {
"fields": [
{
"declarator": "req",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequest req;",
"type": "HttpServletRequest",
"var_name": "req"
},
{
"declarator": "res",
"modifier": "@Mock\n private",
"original_stri... | {
"body": "@Test\n public void should_verify_authorisation_for_the_given_location_param() throws Exception {\n\n final ApplicationResourceServlet applicationResourceServlet = spy(new ApplicationResourceServlet());\n when(req.getParameter(\"process\")).thenReturn(\"processUUIDStr\");\n when(req... | {
"fields": [
{
"declarator": "serialVersionUID = 5209516978177786895L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 5209516978177786895L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "PROCE... | {
"body": "protected long getTenantID(final HttpServletRequest request) throws NoCredentialsInSessionException {\n final HttpSession httpSession = request.getSession();\n final APISession aAPISession = (APISession) httpSession.getAttribute(SessionUtil.API_SESSION_PARAM_KEY);\n return aAPISession.... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_450 | {
"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_id_on_convert_attribute_id() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_ID);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescriptor.ID);\n }",
... | {
"fields": [
{
"declarator": "mapping",
"modifier": "private final",
"original_string": "private final Map<String, String> mapping;",
"type": "Map<String, String>",
"var_name": "mapping"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/... | {
"body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }",
"class_method_signature": "ApplicationSearchDescriptorConverter.convert(final String attribute)",
"constructor": false,
"full_signature": "@Override public String convert(... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_145 | {
"fields": [
{
"declarator": "SESSION_CSRF_TOKEN = \"csrftoken\"",
"modifier": "public static final",
"original_string": "public static final String SESSION_CSRF_TOKEN = \"csrftoken\";",
"type": "String",
"var_name": "SESSION_CSRF_TOKEN"
},
{
"declarator": "request = n... | {
"body": "@Test\n public void should_check_csrf_token_from_request_parameter() throws Exception {\n request.addParameter(\"CSRFToken\", SESSION_CSRF_TOKEN);\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isTrue();\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "CSRF_TOKEN_PARAM = \"CSRFToken\"",
"modifier": "private static final",
"original_string": "private static final String CSRF_TOKEN_PARAM = \"CSRFToken\";",
"type": "String",
"var_name": "CSRF_TOKEN_PARAM"
},
{
"declarator": "CSRF_TOKEN_HEAD... | {
"body": "@Override\n boolean checkValidCondition(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {\n\n if (isCsrfProtectionEnabled() && !isSafeMethod(httpRequest.getMethod())) {\n String headerFromRequest = getCSRFToken(httpRequest);\n String apiToken = (String) htt... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_515 | {
"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_id_on_convert_attribute_id() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationPageItem.ATTRIBUTE_ID);\n\n //then\n assertThat(convertedValue).isEqualTo(ApplicationPageSea... | {
"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_846 | {
"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_check_password_robustness_on_update() throws Exception {\n expectedException.expect(ValidationException.class);\n //see TestValidator class\n expectedException.expectMessage(\"the validator TestValidator rejected this password\");\n\n apiUser.update... | {
"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_391 | {
"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_BusinessDataQueryResource_for_BusinessDataQueryResourceFinder() {\n final BusinessDataQueryResourceFinder businessDataQueryResourceFinder = spy(new BusinessDataQueryResourceFinder());\n doReturn(commandAPI).when(businessDataQueryResourceFinder).getCommandA... | {
"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_684 | {
"fields": [
{
"declarator": "processAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProcessAPI processAPI;",
"type": "ProcessAPI",
"var_name": "processAPI"
},
{
"declarator": "caseEngineClient",
"modifier": "private",
"origin... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Test(expected = APIException.class)\n public void cant_create_case_with_variables_if_process_is_not_activated() throws Exception {\n when(processAPI.startProcess(anyLong(), anyMap())).thenThrow(new ProcessActivationException(\"\"));\n\n caseEngineClie... | {
"fields": [
{
"declarator": "processAPI",
"modifier": "protected",
"original_string": "protected ProcessAPI processAPI;",
"type": "ProcessAPI",
"var_name": "processAPI"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CaseEngineClient.java",
... | {
"body": "public ProcessInstance start(final long userId, final long processId) {\n return start(userId, processId, null);\n }",
"class_method_signature": "CaseEngineClient.start(final long userId, final long processId)",
"constructor": false,
"full_signature": "public ProcessInstance start(final lon... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_407 | {
"fields": [
{
"declarator": "engineSession",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private APISession engineSession;",
"type": "APISession",
"var_name": "engineSession"
},
{
"declarator": "commonDatastore",
"modifier": "@InjectMocks\n ... | {
"body": "@Test\n public void addStringFilterToSearchBuilder_should_do_nothing_when_filters_is_null() {\n // given:\n final SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 10);\n // when:\n commonDatastore.addStringFilterToSearchBuilder(null, searchOptionsBuilde... | {
"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_13 | {
"fields": [
{
"declarator": "formServiceProviderImpl",
"modifier": "@Spy",
"original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;",
"type": "FormServiceProviderImpl",
"var_name": "formServiceProviderImpl"
},
{
"declarator": "workflowAPI",
... | {
"body": "@Test\n public void should_canUserViewActivityInstanceForm_return_true_for_admin() throws Exception {\n final String formId = \"formId\";\n final long userId = 2L;\n final long activityInstanceID = 3L;\n\n //given\n doReturn(1L).when(formWorkflowAPIImpl).getProcessDefi... | {
"fields": [
{
"declarator": "UI_FORM_MODE = \"form\"",
"modifier": "private static final",
"original_string": "private static final String UI_FORM_MODE = \"form\";",
"type": "String",
"var_name": "UI_FORM_MODE"
},
{
"declarator": "LOGGER",
"modifier": "protected... | {
"body": "protected void canUserViewActivityInstanceForm(final APISession session, final User user, final IFormWorkflowAPI workflowAPI,\n final long activityInstanceID, final String formId, final long userId,\n final Map<String, Object> context) throws BPMEngineException, InvalidSessionExceptio... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_811 | {
"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_call_deleteFiles() throws ProcessDefinitionNotFoundException, FileNotFoundException, ProcessExecutionException, ProcessActivationException, ContractViolationException {\n //given\n doReturn(Long.toString(PROCESS_DEFINITION_ID)).when(processInstantiationResource).... | {
"fields": [
{
"declarator": "CASE_ID_ATTRIBUTE = \"caseId\"",
"modifier": "private static final",
"original_string": "private static final String CASE_ID_ATTRIBUTE = \"caseId\";",
"type": "String",
"var_name": "CASE_ID_ATTRIBUTE"
},
{
"declarator": "PROCESS_DEFINITION... | {
"body": "@Post(\"json\")\n public String instantiateProcess(final Map<String, Serializable> inputs) throws ProcessDefinitionNotFoundException, ProcessActivationException,\n ProcessExecutionException, FileNotFoundException {\n final String userId = getRequestParameter(USER_PARAM);\n final... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_542 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private ArchivedCaseDocumentDatastore documentDatastore;",
"type": "ArchivedCaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"... | {
"body": "@Test\n public void it_should_delete_one_document() throws DocumentNotFoundException, DocumentException {\n final List<APIID> docs = new ArrayList<>();\n docs.add(APIID.makeAPIID(mockedDocument.getId()));\n\n // When\n documentDatastore.delete(docs);\n\n // Then\n ... | {
"fields": [
{
"declarator": "constants",
"modifier": "protected final",
"original_string": "protected final WebBonitaConstantsUtils constants;",
"type": "WebBonitaConstantsUtils",
"var_name": "constants"
},
{
"declarator": "processAPI",
"modifier": "protected fi... | {
"body": "@Override\n public void delete(final List<APIID> ids) {\n if (ids != null) {\n\n try {\n for (final APIID id : ids) {\n processAPI.deleteContentOfArchivedDocument(id.toLong());\n }\n } catch (final DocumentNotFoundException e)... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_112 | {
"fields": [
{
"declarator": "processFormService",
"modifier": "@Spy",
"original_string": "@Spy\n ProcessFormService processFormService;",
"type": "ProcessFormService",
"var_name": "processFormService"
},
{
"declarator": "processAPI",
"modifier": "@Mock",
... | {
"body": "@Test\n public void isAllowedToSeeTask_should_return_true() throws Exception {\n when(processAPI.isInvolvedInHumanTaskInstance(1L, 42L)).thenReturn(true);\n when(processAPI.getHumanTaskInstance(42L)).thenReturn(mock(HumanTaskInstance.class));\n\n final boolean isAllowedToSeeTask = p... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public boolean isAllowedToSeeTask(final APISession apiSession, final long taskInstanceId, final long enforcedUserId,\n final boolean assignTask) throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n try {\n if (processAPI.isInvolvedInHuman... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_387 | {
"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_TimerEventTriggerResource_for_TimerEventTriggerResourceFinder() {\n final TimerEventTriggerResourceFinder timerEventTriggerResourceFinder = spy(new TimerEventTriggerResourceFinder());\n doReturn(processAPI).when(timerEventTriggerResourceFinder).getProcessA... | {
"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_738 | {
"fields": [],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/api/system/TokenListProviderTest.java",
"identifier": "TokenListProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void should_return_the_list_of_provided_token_without_null() throws Exception {\n\n TokenListProvider provider = new TokenListProvider(Arrays.asList(\n \"token 1\",\n null,\n \"token 2\"));\n\n assertThat(provider.getTokens()).con... | {
"fields": [
{
"declarator": "tokens = new ArrayList<String>()",
"modifier": "private",
"original_string": "private List<String> tokens = new ArrayList<String>();",
"type": "List<String>",
"var_name": "tokens"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server... | {
"body": "@Override\n public List<String> getTokens() {\n return tokens;\n }",
"class_method_signature": "TokenListProvider.getTokens()",
"constructor": false,
"full_signature": "@Override public List<String> getTokens()",
"identifier": "getTokens",
"invocations": [],
"modifiers": "@Override... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_692 | {
"fields": [
{
"declarator": "businessDataModelResource",
"modifier": "protected",
"original_string": "protected BusinessDataModelResource businessDataModelResource;",
"type": "BusinessDataModelResource",
"var_name": "businessDataModelResource"
},
{
"declarator": "tena... | {
"body": "@Test\n public void should_throws_an_exception_adding_a_document_with_unauthorized_path() throws Exception {\n final BusinessDataModelItem item = new BusinessDataModelItem();\n item.setFileUpload(\"../../../bdmFile.zip\");\n doThrow(new APIForbiddenException(\"\")).when(bonitaHomeFo... | {
"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_368 | {
"fields": [
{
"declarator": "hsRequest",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest hsRequest;",
"type": "HttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse",
"modifier": "@Mock",
"original_string": "@Mo... | {
"body": "@Test\n public void should_send_error_500_on_searchException() throws Exception {\n doThrow(new CreationException(\"error\")).when(router).route(eq(hsRequest), eq(hsResponse), eq(session), eq(pageRenderer), eq(resourceRenderer), any(BonitaHomeFolderAccessor.class));\n\n servlet.service(hsR... | {
"fields": [
{
"declarator": "serialVersionUID = -3911437607969651000L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3911437607969651000L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOG... | {
"body": "@Override\n protected void service(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse)\n throws ServletException, IOException {\n\n final APISession session = getSession(hsRequest);\n\n // Check if requested URL is missing final slash (necessary in order to... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_411 | {
"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_less_than_filter_when_is_applicable() {\n // given:\n final String filterName = \"someFilterKey\";\n final String engineAttributeName = \"EngineNumericKey\";\n final Map<String, String> filters = new HashMap<String... | {
"fields": [
{
"declarator": "engineSession",
"modifier": "private",
"original_string": "private APISession engineSession;",
"type": "APISession",
"var_name": "engineSession"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/CommonDatastore.java",
... | {
"body": "protected void 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_104 | {
"fields": [
{
"declarator": "accessor",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HtmlAccessor accessor;",
"type": "HtmlAccessor",
"var_name": "accessor"
}
],
"file": "portal/src/test/java/org/bonitasoft/web/toolkit/client/ui/html/VariableUtil... | {
"body": "@Test\n public void testWeCanReplaceMultipleVariables() throws Exception {\n doReturn(\"<p class='%variable%'>This is %variable%</p>\")\n .when(accessor)\n .getInnerHTML();\n\n VariableUtils.inject(accessor, \"variable\", SafeHtmlUtils.fromTrustedString(\"work... | {
"fields": [],
"file": "portal/src/main/java/org/bonitasoft/web/toolkit/client/ui/html/VariableUtils.java",
"identifier": "VariableUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "VariableUtils.inject(HtmlAccessor accessor, String name, SafeHtml value)",
"constructor": fals... | {
"body": "public static void inject(HtmlAccessor accessor, String name, SafeHtml value) {\n accessor.setInnerHTML(replaceAll(accessor.getInnerHTML(), name, value));\n }",
"class_method_signature": "VariableUtils.inject(HtmlAccessor accessor, String name, SafeHtml value)",
"constructor": false,
"full_... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_554 | {
"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_adding_a_document_with_unauthorized_path() throws IOException {\n // Given\n final URL docUrl = getClass().getResource(\"/doc.jpg\");\n mockedDocumentItem.setAttribute(CaseDocumentItem.ATTRIBUTE_CASE_... | {
"fields": [
{
"declarator": "constants",
"modifier": "protected final",
"original_string": "protected final WebBonitaConstantsUtils constants;",
"type": "WebBonitaConstantsUtils",
"var_name": "constants"
},
{
"declarator": "processAPI",
"modifier": "protected fi... | {
"body": "@Override\n public CaseDocumentItem add(final CaseDocumentItem item) {\n\n long caseId = -1;\n int index = -1;\n String documentDescription = \"\";\n DocumentValue documentValue = null;\n\n try {\n if (item.getAttributeValue(CaseDocumentItem.ATTRIBUTE_CASE_I... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_807 | {
"fields": [
{
"declarator": "processAPI",
"modifier": "@Mock",
"original_string": "@Mock\n ProcessAPI processAPI;",
"type": "ProcessAPI",
"var_name": "processAPI"
},
{
"declarator": "activityVariableResource",
"modifier": "@Spy\n @InjectMocks\n private"... | {
"body": "@Test(expected = APIException.class)\n public void should_throw_exception_if_attribute_is_not_found() throws Exception {\n // given:\n doReturn(null).when(activityVariableResource).getAttribute(anyString());\n\n // when:\n activityVariableResource.getTaskVariable();\n }",
... | {
"fields": [
{
"declarator": "ACTIVITYDATA_ACTIVITY_ID = \"activityid\"",
"modifier": "public static final",
"original_string": "public static final String ACTIVITYDATA_ACTIVITY_ID = \"activityid\";",
"type": "String",
"var_name": "ACTIVITYDATA_ACTIVITY_ID"
},
{
"decla... | {
"body": "@Get(\"json\")\n public DataInstance getTaskVariable() {\n try {\n final String taskId = getAttribute(ACTIVITYDATA_ACTIVITY_ID);\n final String dataName = getAttribute(ACTIVITYDATA_DATA_NAME);\n return getTaskVariableInstance(dataName, Long.valueOf(taskId));\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_780 | {
"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 get_should_get_case_item_on_CaseDatastore() {\n // Given\n final APIID id = APIID.makeAPIID(78L);\n final CaseItem item = mock(CaseItem.class);\n doReturn(item).when(caseDatastore).get(id);\n\n // When\n final CaseItem result = apiCase.... | {
"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 CaseItem get(final APIID id) {\n return getCaseDatastore().get(id);\n }",
"class_method_signature": "APICase.get(final APIID id)",
"constructor": false,
"full_signature": "@Override public CaseItem get(final APIID id)",
"identifier": "get",
"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_295 | {
"fields": [
{
"declarator": "PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\"",
"modifier": "public static final",
"original_string": "public static final String PAGE_NO_API_EXTENSION_PROPERTIES = \"pageNoApiExtension.properties\";",
"type": "String",
"var_name"... | {
"body": "@Test\n public void should_add_page_root_folder_in_classpath() throws Exception {\n final File pageDir = new File(getClass().getResource(\"/ARootPageFolder\").getFile());\n final GroovyClassLoader classloader = customPageService.buildPageClassloader(apiSession, \"pageName\", pageDir);\n ... | {
"fields": [
{
"declarator": "PAGE_PROPERTIES = \"page.properties\"",
"modifier": "private static final",
"original_string": "private static final String PAGE_PROPERTIES = \"page.properties\";",
"type": "String",
"var_name": "PAGE_PROPERTIES"
},
{
"declarator": "GET_SY... | {
"body": "protected GroovyClassLoader buildPageClassloader(final APISession apiSession, final String pageName,\n final File pageDirectory)\n throws CompilationFailedException, IOException {\n GroovyClassLoader pageClassLoader = PAGES_CLASSLOADERS.get(pageName);\n final BDMClientDe... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_446 | {
"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 toApplicationUpdater_should_map_all_fields() {\n\n //given\n final HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(ApplicationItem.ATTRIBUTE_TOKEN, TOKEN);\n fields.put(ApplicationItem.ATTRIBUTE_DISPLAY_NAME, DISPLAY_NAME);\n ... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/ApplicationItemConverter.java",
"identifier": "ApplicationItemConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ApplicationItemConverter.toApplicationItem(final Application applic... | {
"body": "public ApplicationUpdater toApplicationUpdater(final Map<String, String> attributes) {\n final ApplicationUpdater applicationUpdater = getApplicationUpdater();\n\n if (attributes.containsKey(ApplicationItem.ATTRIBUTE_TOKEN)) {\n applicationUpdater.setToken(attributes.get(Applicatio... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_52 | {
"fields": [
{
"declarator": "testDirectory = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder testDirectory = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "testDirectory"
},
{
"declarator... | {
"body": "@Test\n public void should_extract_the_given_zip_into_destination_folder() throws Exception {\n final ThemeArchive themeArchive = new ThemeArchive(createStyleFiles(\"bonita.css\"));\n\n themeArchive.extract(themeDirectory);\n\n assertThat(themeDirectory.list()).containsOnly(\"bonita... | {
"fields": [
{
"declarator": "zippedTheme",
"modifier": "private",
"original_string": "private byte[] zippedTheme;",
"type": "byte[]",
"var_name": "zippedTheme"
}
],
"file": "common/src/main/java/org/bonitasoft/console/common/server/themes/ThemeArchive.java",
"identifier":... | {
"body": "public ThemeModifier extract(File themeDirectory) throws IOException {\n checkZippedThemeIsSet();\n FileUtils.deleteDirectory(themeDirectory);\n try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(zippedTheme)) {\n UnzipUtil.unzip(byteArrayInputStream, ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_850 | {
"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_add_user_if_password_is_valid() throws Exception {\n UserItem userItem = new UserItem();\n userItem.setUserName(\"John\");\n userItem.setPassword(\"accepted password\");\n\n apiUser.add(userItem);\n }",
"class_method_signature": "APIUserTest.sh... | {
"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 add(final UserItem item) {\n\n // Finish the upload of the icon\n if (StringUtil.isBlank(item.getPassword())) {\n throw new ValidationException(Collections.singletonList(new ValidationError(\"Password\", \"%attribute% is mandatory\")));\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_503 | {
"fields": [],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/entry/ProfileEntrySearchDescriptorConverterTest.java",
"identifier": "ProfileEntrySearchDescriptorConverterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWeCanConvertTheProfileEntryId() throws Exception {\n String descriptor = new ProfileEntrySearchDescriptorConverter()\n .convert(ProfileEntryItem.ATTRIBUTE_ID);\n\n assertEquals(ProfileEntrySearchDescriptor.ID, descriptor);\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "mapping",
"modifier": "private final",
"original_string": "private final Map<String, String> mapping;",
"type": "Map<String, String>",
"var_name": "mapping"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/entr... | {
"body": "@Override\n public String convert(String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }",
"class_method_signature": "ProfileEntrySearchDescriptorConverter.convert(String attribute)",
"constructor": false,
"full_signature": "@Override public String convert(String attr... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_153 | {
"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_dynamicCheck_return_false_on_resource_with_no_script() throws Exception {\n final boolean isAuthorized = restAPIAuthorizationFilter.dynamicCheck(new APICallContext(\"GET\", \"bpm\", \"case\", null, \"\", \"\"), new HashSet<String>(),\n new HashSet<String>... | {
"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 dynamicCheck(final APICallContext apiCallContext, final Set<String> userPermissions, final Set<String> resourceAuthorizations,\n final APISession apiSession) throws ServletException {\n checkResourceAuthorizationsSyntax(resourceAuthorizations);\n if (checkDynamicP... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_344 | {
"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_getId_return_applicationId() throws Exception {\n assertThat(model.getId()).isEqualTo(1L);\n }",
"class_method_signature": "ApplicationModelTest.should_getId_return_applicationId()",
"constructor": false,
"full_signature": "@Test public void should_getId_return... | {
"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 long getId() {\n return application.getId();\n }",
"class_method_signature": "ApplicationModel.getId()",
"constructor": false,
"full_signature": "public long getId()",
"identifier": "getId",
"invocations": [
"getId"
],
"modifiers": "public",
"parameters": "()",
"retur... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_714 | {
"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 parseFilterWithSpecialCharactersShouldBuildExpectedMap() throws Exception {\n // given:\n final List<String> filters = Arrays.asList(\"a=b\", \"c=/d/d,e\");\n\n // when:\n final Map<String, String> parseFilters = new CommonResource().parseFilters(filters);... | {
"fields": [
{
"declarator": "sessionSingleton = null",
"modifier": "private",
"original_string": "private APISession sessionSingleton = null;",
"type": "APISession",
"var_name": "sessionSingleton"
},
{
"declarator": "LOGGER = Logger.getLogger(CommonResource.class.getN... | {
"body": "protected Map<String, String> parseFilters(final List<String> parameters) {\n if (parameters == null) {\n return null;\n }\n final Map<String, String> results = new HashMap<>();\n for (final String parameter : parameters) {\n final String[] split = paramete... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_201 | {
"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_tenant_cookie_from_request() throws Exception {\n request.setCookies(new Cookie(\"bonita.tenant\", \"123\"));\n\n String tenant = portalCookies.getTenantCookieFromRequest(request);\n\n assertThat(tenant).isEqualTo(\"123\");\n }",
"class_method_sig... | {
"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 String getTenantCookieFromRequest(HttpServletRequest request) {\n return getCookieValue(request, TENANT_COOKIE_NAME);\n }",
"class_method_signature": "PortalCookies.getTenantCookieFromRequest(HttpServletRequest request)",
"constructor": false,
"full_signature": "public String getTena... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_651 | {
"fields": [
{
"declarator": "identityAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IdentityAPI identityAPI;",
"type": "IdentityAPI",
"var_name": "identityAPI"
},
{
"declarator": "userEngineClient",
"modifier": "private",
"o... | {
"body": "@Test(expected = APIException.class)\n public void get_throw_APIException_if_user_is_not_found_in_engine_repository() throws Exception {\n when(identityAPI.getUser(1L)).thenThrow(new UserNotFoundException(\"aMessage\"));\n \n userEngineClient.get(1L);\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "identityAPI",
"modifier": "private",
"original_string": "private IdentityAPI identityAPI;",
"type": "IdentityAPI",
"var_name": "identityAPI"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/UserEngineClient.java",
... | {
"body": "public User get(long userId) {\n try {\n return identityAPI.getUser(userId);\n } catch (UserNotFoundException e) {\n throw new APIException(new _(\"User not found\"), e);\n }\n }",
"class_method_signature": "UserEngineClient.get(long userId)",
"constructor"... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_578 | {
"fields": [
{
"declarator": "processAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProcessAPI processAPI;",
"type": "ProcessAPI",
"var_name": "processAPI"
},
{
"declarator": "datastore",
"modifier": "private",
"original_stri... | {
"body": "@Test\n public void searchCanBePaginated() throws Exception {\n final ConnectorImplementationDescriptor connectorWith3Dependencies = new ConnectorImplementationDescriptor(\n \"implementationClassName\", \"connectorId\", \"connectorVersion\", \"1\", \"definitionVersion\",\n ... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/ProcessConnectorDependencyDatastore.java",
"identifier": "ProcessConnectorDependencyDatastore",
"interfaces": "implements\n DatastoreHasSearch<ProcessConnectorDependencyItem>",
"methods": [
{
"c... | {
"body": "@Override\n @SuppressWarnings(\"unchecked\")\n public ItemSearchResult<ProcessConnectorDependencyItem> search(final int page, final int resultsByPage, \n final String search, final String orders, final Map<String, String> filters) {\n\n try {\n final Long processId = MapU... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_128 | {
"fields": [
{
"declarator": "pageRenderer",
"modifier": "@Mock",
"original_string": "@Mock\n PageRenderer pageRenderer;",
"type": "PageRenderer",
"var_name": "pageRenderer"
},
{
"declarator": "processFormService",
"modifier": "@Mock",
"original_string":... | {
"body": "@Test\n public void should_get_not_found_when_invalid_processInstanceId() throws Exception {\n when(hsRequest.getPathInfo()).thenReturn(\"/processInstance/42/\");\n when(processFormService.ensureProcessDefinitionId(apiSession, -1L, 42L, -1L)).thenThrow(ArchivedProcessInstanceNotFoundExcept... | {
"fields": [
{
"declarator": "serialVersionUID = -6397856355139281873L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -6397856355139281873L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOG... | {
"body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n long processDefinitionId = -1L;\n long processInstanceId = -1L;\n long taskInstanceId = -1L;\n String taskName = null;\n fina... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_29 | {
"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_evaluateActivityInitialExpressions() throws Exception {\n // Given\n formWorkflowAPIImpl = spy(new FormWorkflowAPIImpl());\n final long processDefinitionID = -1;\n final long activityInstanceID = 1;\n expressions = new ArrayList<Expre... | {
"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_597 | {
"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_update_parent_path_if_a_parent_group_id_is_specified() throws Exception {\n HashMap<String, String> attributes = buildSimpleAttribute(GroupItem.ATTRIBUTE_PARENT_GROUP_ID, \"101\");\n when(groupEngineClient.getPath(\"101\")).thenReturn(\"/Expected/Parent/Path\");... | {
"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_743 | {
"fields": [
{
"declarator": "dataStoreFactory",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private APIApplicationDataStoreFactory dataStoreFactory;",
"type": "APIApplicationDataStoreFactory",
"var_name": "dataStoreFactory"
},
{
"declarator": "app... | {
"body": "@Test\n public void add_should_return_the_result_of_dataStore_add() throws Exception {\n //given\n final ApplicationPageItem itemToCreate = mock(ApplicationPageItem.class);\n final ApplicationPageItem createdItem = mock(ApplicationPageItem.class);\n given(applicationPageDataS... | {
"fields": [
{
"declarator": "factory",
"modifier": "private final",
"original_string": "private final APIApplicationDataStoreFactory factory;",
"type": "APIApplicationDataStoreFactory",
"var_name": "factory"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/... | {
"body": "@Override\n public ApplicationPageItem add(final ApplicationPageItem item) {\n return factory.createApplicationPageDataStore(getEngineSession()).add(item);\n }",
"class_method_signature": "APIApplicationPage.add(final ApplicationPageItem item)",
"constructor": false,
"full_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_313 | {
"fields": [
{
"declarator": "hsRequest = new MockHttpServletRequest()",
"modifier": "",
"original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();",
"type": "MockHttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse = ne... | {
"body": "@Test\n public void should_get_pageResourceProvider_by_pageId() throws Exception {\n //given\n final String pageName = \"pageName\";\n doReturn(pageName).when(page).getName();\n doReturn(page).when(customPageService).getPage(apiSession, 42L);\n\n //when\n final ... | {
"fields": [
{
"declarator": "PROFILE_PARAM = \"profile\"",
"modifier": "public static final",
"original_string": "public static final String PROFILE_PARAM = \"profile\";",
"type": "String",
"var_name": "PROFILE_PARAM"
},
{
"declarator": "LOCALE_PARAM = \"locale\"",
... | {
"body": "public PageResourceProviderImpl getPageResourceProvider(final String pageName, final long tenantId) {\n return new PageResourceProviderImpl(pageName, tenantId);\n }",
"class_method_signature": "PageRenderer.getPageResourceProvider(final String pageName, final long tenantId)",
"constructor": f... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_606 | {
"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 convertManagerId() throws Exception {\n String convert = converter.convert(UserItem.ATTRIBUTE_MANAGER_ID);\n\n assertEquals(UserSearchDescriptor.MANAGER_USER_ID, convert);\n }",
"class_method_signature": "UserSearchAttributeConverterTest.convertManagerId()",
"con... | {
"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_256 | {
"fields": [
{
"declarator": "request",
"modifier": "private",
"original_string": "private MockHttpServletRequest request;",
"type": "MockHttpServletRequest",
"var_name": "request"
},
{
"declarator": "requestAccessor",
"modifier": "private",
"original_strin... | {
"body": "@Test\n public void should_add_tenant_parameter_contained_in_request_params() throws Exception {\n request.setParameter(\"tenant\", \"4\");\n request.setCookies(new Cookie(\"bonita.tenant\", \"123\"));\n String redirectUrl = \"%2Fportal%2Fhomepage\";\n\n String loginURL = sta... | {
"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_485 | {
"fields": [
{
"declarator": "tenantAdminDatastore = null",
"modifier": "private",
"original_string": "private TenantAdminDatastore tenantAdminDatastore = null;",
"type": "TenantAdminDatastore",
"var_name": "tenantAdminDatastore"
},
{
"declarator": "tenantAdministratio... | {
"body": "@Test\n public void testUpdateGoInMaintenance() throws Exception {\n when(tenantAdministrationAPI.isPaused()).thenReturn(false);\n final APIID apiid = APIID.makeAPIID(1L);\n\n final TenantAdminItem tenantAdminItem = tenantAdminDatastore.update(apiid,\n mapOf(TenantAdm... | {
"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_91 | {
"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 testWeCanConvertExceptionWithoutMessage() throws Exception {\n HttpException exception = new HttpException();\n JsonExceptionSerializer serializer = new JsonExceptionSerializer(exception);\n\n String json = serializer.end();\n\n assertEquals(exception, jso... | {
"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_893 | {
"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 emptyIsConvertedToNull() throws Exception {\n\n Boolean converted = converter.convert(\"\");\n\n assertNull(converted);\n }",
"class_method_signature": "BooleanConverterTest.emptyIsConvertedToNull()",
"constructor": false,
"full_signature": "@Test public void e... | {
"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_190 | {
"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 testProtectRedirectUrlShouldRemoveHTTPSFromURL() {\n assertEquals(\"google\", urlProtecter.protectRedirectUrl(\"httpsgoogle\"));\n }",
"class_method_signature": "URLProtectorTest.testProtectRedirectUrlShouldRemoveHTTPSFromURL()",
"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_305 | {
"fields": [
{
"declarator": "hsRequest = new MockHttpServletRequest()",
"modifier": "",
"original_string": "MockHttpServletRequest hsRequest = new MockHttpServletRequest();",
"type": "MockHttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse = ne... | {
"body": "@Test\n public void getResource_should_get_Forbidden_Status_when_unAuthorize() throws Exception {\n hsRequest.setPathInfo(\"/custompage_htmlexample/css/../../../file.css\");\n final File pageDir = new File(\".\");\n given(resourceRenderer.getPathSegments(\"/custompage_htmlexample/cs... | {
"fields": [
{
"declarator": "APP_TOKEN_PARAM = \"appToken\"",
"modifier": "public static final",
"original_string": "public static final String APP_TOKEN_PARAM = \"appToken\";",
"type": "String",
"var_name": "APP_TOKEN_PARAM"
},
{
"declarator": "serialVersionUID = -54... | {
"body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n /*\n * Check if requested URL is missing last slash, like \"custom-page/page-name\".\n * If missing, redirect to \"custom-page/page-name/... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_755 | {
"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_empty_string_in_message_content_values() throws Exception {\n // given:\n final BPMMessage bpmMessage = new BPMMessage();\n bpmMessage.setMessageName(\"msg\");\n bpmMessage.setTargetProcess(\"myProcess\");\n bpmMessage.setT... | {
"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_240 | {
"fields": [
{
"declarator": "DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L",
"modifier": "public static final",
"original_string": "public static final long DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L;",
"type": "long",
"var_name": "DATE_01_01_1970_13H_AS_LONG_GMT"
},
{
... | {
"body": "@Test\n public void convertToType_should_correctly_parse_incoming_objects() {\n Object date = new ContractTypeConverter(ISO_8601_DATE_PATTERNS).convertToType(Type.DATE, \"2017-12-25\");\n assertThat(date.getClass()).isEqualTo(Date.class);\n Object validLocalDate = new ContractTypeCo... | {
"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_610 | {
"fields": [
{
"declarator": "TENANT_ID = 67534L",
"modifier": "private static final",
"original_string": "private static final long TENANT_ID = 67534L;",
"type": "long",
"var_name": "TENANT_ID"
},
{
"declarator": "roleDatastore",
"modifier": "@InjectMocks\n @... | {
"body": "@Test\n public void should_retrieve_role_from_engine() throws Exception {\n //given\n doReturn(new RoleImpl(123, \"myRole\")).when(identityAPI).getRole(123L);\n //when\n RoleItem roleItem = roleDatastore.get(APIID.makeAPIID(123L));\n //then\n assertThat(roleItem... | {
"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 get(final APIID id) {\n try {\n return convertEngineToConsoleItem(getIdentityAPI().getRole(id.toLong()));\n } catch (final Exception e) {\n throw new APIException(e);\n }\n }",
"class_method_signature": "RoleDatastore.get(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_87 | {
"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_custom_properties_if_exist() throws Exception {\n // given:\n Map<String, Properties> propertiesMap = new HashMap<>(2);\n final Properties defaultProps = new Properties();\n defaultProps.put(\"def... | {
"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_539 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private ArchivedCaseDocumentDatastore documentDatastore;",
"type": "ArchivedCaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"... | {
"body": "@Test\n public void it_should_convert_item_return_item() throws Exception {\n // When\n final ArchivedCaseDocumentItem convertedEngineToConsoleItem = documentDatastore.convertEngineToConsoleItem(mockedDocument);\n // Then\n assertTrue(convertedEngineToConsoleItem != null);\n ... | {
"fields": [
{
"declarator": "constants",
"modifier": "protected final",
"original_string": "protected final WebBonitaConstantsUtils constants;",
"type": "WebBonitaConstantsUtils",
"var_name": "constants"
},
{
"declarator": "processAPI",
"modifier": "protected fi... | {
"body": "@Override\n protected ArchivedCaseDocumentItem convertEngineToConsoleItem(final ArchivedDocument item) {\n if (item != null) {\n return new ArchivedCaseDocumentItemConverter().convert(item);\n }\n return null;\n }",
"class_method_signature": "ArchivedCaseDocumentData... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_493 | {
"fields": [
{
"declarator": "pageLister",
"modifier": "private",
"original_string": "private PageLister pageLister;",
"type": "PageLister",
"var_name": "pageLister"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/datastore/profile/PageListerTest.java",
"... | {
"body": "@Test\n public void getPages_return_all_pages_not_in_pagesToSkip_list() throws Exception {\n final BonitaPageItem pageToSkip1 = PageLister.pages.get(0);\n final BonitaPageItem pageToSkip2 = PageLister.pages.get(1);\n final List<BonitaPageItem> expectedPages = buildExpectedPagesList(... | {
"fields": [
{
"declarator": "pages = new ArrayList<BonitaPageItem>()",
"modifier": "protected final static",
"original_string": "protected final static List<BonitaPageItem> pages = new ArrayList<BonitaPageItem>();",
"type": "List<BonitaPageItem>",
"var_name": "pages"
}
],
"... | {
"body": "public List<BonitaPageItem> getPages() {\n return pages;\n }",
"class_method_signature": "PageLister.getPages()",
"constructor": false,
"full_signature": "public List<BonitaPageItem> getPages()",
"identifier": "getPages",
"invocations": [],
"modifiers": "public",
"parameters": "()",... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_169 | {
"fields": [
{
"declarator": "requestAccessor",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequestAccessor requestAccessor;",
"type": "HttpServletRequestAccessor",
"var_name": "requestAccessor"
},
{
"declarator": "tenantIdAccess... | {
"body": "@Test\n public void testNullTenantId() throws Exception {\n doReturn(null).when(requestAccessor).getTenantId();\n\n TenantIdAccessor accessor = new TenantIdAccessor(requestAccessor);\n\n assertEquals(-1L, accessor.getRequestedTenantId());\n }",
"class_method_signature": "Tenant... | {
"fields": [
{
"declarator": "request",
"modifier": "private",
"original_string": "private HttpServletRequestAccessor request;",
"type": "HttpServletRequestAccessor",
"var_name": "request"
},
{
"declarator": "portalCookies = new PortalCookies()",
"modifier": "pri... | {
"body": "public long getRequestedTenantId() throws ServletException {\n return parseTenantId(request.getTenantId());\n }",
"class_method_signature": "TenantIdAccessor.getRequestedTenantId()",
"constructor": false,
"full_signature": "public long getRequestedTenantId()",
"identifier": "getRequestedT... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_186 | {
"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 testUrlStayEmptyIfParameterIsEmpty() throws Exception {\n final LoginServlet servlet = new LoginServlet();\n\n final String cleanQueryString = servlet.dropPassword(\"\");\n\n assertThat(cleanQueryString, is(\"\"));\n }",
"class_method_signature": "LoginServl... | {
"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_68 | {
"fields": [
{
"declarator": "securityProperties",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private SecurityProperties securityProperties;",
"type": "SecurityProperties",
"var_name": "securityProperties"
},
{
"declarator": "platformManagementUti... | {
"body": "@Test\n public void should_reloadPropertiesIfInDebug_do_not_reload_properties_when_not_in_debug() throws Exception {\n //given\n doReturn(false).when(securityProperties).isAPIAuthorizationsCheckInDebugMode();\n //when\n PermissionsBuilderAccessor.reloadPropertiesIfInDebug(sec... | {
"fields": [],
"file": "common/src/main/java/org/bonitasoft/console/common/server/utils/PermissionsBuilderAccessor.java",
"identifier": "PermissionsBuilderAccessor",
"interfaces": "",
"methods": [
{
"class_method_signature": "PermissionsBuilderAccessor.createPermissionBuilder(final APISession sessi... | {
"body": "static void reloadPropertiesIfInDebug(SecurityProperties securityProperties, PlatformManagementUtils platformManagementUtils) throws LoginFailedException {\n if (securityProperties.isAPIAuthorizationsCheckInDebugMode()) {\n try {\n platformManagementUtils.initializePlatform... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_885 | {
"fields": [
{
"declarator": "converter",
"modifier": "private",
"original_string": "private IntegerConverter converter;",
"type": "IntegerConverter",
"var_name": "converter"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/In... | {
"body": "@Test(expected = ConversionException.class)\n public void nonParsableStringThrowAConversionException() throws Exception {\n converter.convert(\"nonParsable\");\n }",
"class_method_signature": "IntegerConverterTest.nonParsableStringThrowAConversionException()",
"constructor": false,
"full... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/IntegerConverter.java",
"identifier": "IntegerConverter",
"interfaces": "implements Converter<Integer>",
"methods": [
{
"class_method_signature": "IntegerConverter.convert(String toBeConverte... | {
"body": "@Override\n public Integer convert(String toBeConverted) throws ConversionException {\n if (toBeConverted == null || toBeConverted.isEmpty()) {\n return null;\n }\n try {\n return Integer.parseInt(toBeConverted);\n } catch (NumberFormatException e) {\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_702 | {
"fields": [
{
"declarator": "caller",
"modifier": "@Mock",
"original_string": "@Mock\n APIServletCall caller;",
"type": "APIServletCall",
"var_name": "caller"
},
{
"declarator": "session",
"modifier": "@Mock\n private",
"original_string": "@Mock\n ... | {
"body": "@Test(expected = APIForbiddenException.class)\n public void should_verify_authorisation_for_the_given_document_path() throws\n Exception {\n\n doThrow(new UnauthorizedFolderException(\"error\")).when(documentDatastore).createDocument(any(Long.class), any(String.class), any(String.class),\n ... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/document/APIDocument.java",
"identifier": "APIDocument",
"interfaces": "",
"methods": [
{
"class_method_signature": "APIDocument.defineItemDefinition()",
"constructor": false,
"full_signature": "@Override pr... | {
"body": "@Override\n public DocumentItem add(final DocumentItem item) {\n final long processInstanceId = Long.valueOf(item.getAttributeValue(DocumentItem.PROCESSINSTANCE_ID));\n final String documentName = item.getAttributeValue(DocumentItem.DOCUMENT_NAME);\n final String path = item.getAttr... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_352 | {
"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_application_is_not_found() throws Exception {\n given(applicationApi.searchApplications(any(SearchOptions.class))).willReturn(\n new SearchResultImpl<Application>(0, Collections.<Applic... | {
"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_647 | {
"fields": [
{
"declarator": "identityAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IdentityAPI identityAPI;",
"type": "IdentityAPI",
"var_name": "identityAPI"
},
{
"declarator": "userEngineClient",
"modifier": "private",
"o... | {
"body": "@Test(expected = APIException.class)\n public void update_throw_APIException_if_exception_occur_when_updating_user_in_engine_repository() throws Exception {\n UserUpdater userUpdater = new UserUpdater();\n when(identityAPI.updateUser(1L, userUpdater)).thenThrow(new UpdateException(\"aMessa... | {
"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_217 | {
"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_a_proper_extension_without_taking_care_of_dots() throws IOException {\n // given\n final String filename = \"C:\\\\Users\\\\Deskt.op\\\\proc.ess.bar\";\n\n // when\n final String extension = fileUploadServlet.getExtension(filenam... | {
"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_581 | {
"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\n public void getRetrieveConnectorImplementationAndSetProcessId() throws Exception {\n final ConnectorImplementationDescriptor descriptor = aConnectorImplementationDescriptor(\"aName\");\n when(this.processAPI.getConnectorImplementation(1L, \"name\", \"1\")).thenReturn(descriptor);\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 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_48 | {
"fields": [
{
"declarator": "directory = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder directory = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "directory"
},
{
"declarator": "modifier... | {
"body": "@Test\n public void should_compile_less_into_css() throws Exception {\n final File lessStyle = directory.newFile(\"style.less\");\n FileUtils.writeStringToFile(lessStyle, \"@myvar:1px;body{width:@myvar}\");\n given(modifier.resolve(\"style.less\")).willReturn(lessStyle);\n\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_519 | {
"fields": [
{
"declarator": "session",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private APISession session;",
"type": "APISession",
"var_name": "session"
},
{
"declarator": "applicationAPI",
"modifier": "@Mock\n private",
"origin... | {
"body": "@Test\n public void should_return_result_of_engine_call_converted_to_item_on_add() throws Exception {\n //given\n final ApplicationPageItem itemToCreate = new ApplicationPageItem();\n itemToCreate.setToken(\"firstPage\");\n itemToCreate.setApplicationId(14L);\n itemToC... | {
"fields": [
{
"declarator": "applicationAPI",
"modifier": "private final",
"original_string": "private final ApplicationAPI applicationAPI;",
"type": "ApplicationAPI",
"var_name": "applicationAPI"
},
{
"declarator": "pageAPI",
"modifier": "private final",
... | {
"body": "@Override\n public ApplicationPageItem add(final ApplicationPageItem item) {\n try {\n final ApplicationPage applicationPage = applicationAPI.createApplicationPage(item.getApplicationId().toLong(), item.getPageId().toLong(),\n item.getToken());\n return co... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_149 | {
"fields": [
{
"declarator": "rule",
"modifier": "@Spy",
"original_string": "@Spy\n V6FormsAutoLoginRule rule;",
"type": "V6FormsAutoLoginRule",
"var_name": "rule"
},
{
"declarator": "request",
"modifier": "@Mock\n private",
"original_string": "@Mock\... | {
"body": "@Test\n public void testWeAreNotAutoLoggedWhenNotConfigured() throws Exception {\n doReturn(\"process3--2.9\").when(request).getAutoLoginScope();\n doReturn(1L).when(tenantAccessor).getRequestedTenantId();\n\n when(autoLoginCredentialsFinder.getCredential(new ProcessIdentifier(\"pro... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(V6FormsAutoLoginRule.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(V6FormsAutoLoginRule.class.getName());",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "@Override\n public boolean doAuthorize(final HttpServletRequestAccessor request, HttpServletResponse response, final TenantIdAccessor tenantIdAccessor) throws ServletException {\n final long tenantId = tenantIdAccessor.ensureTenantId();\n return doAutoLogin(request, response, tenantId);\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_260 | {
"fields": [
{
"declarator": "PAGE_ID = 42L",
"modifier": "public static final",
"original_string": "public static final long PAGE_ID = 42L;",
"type": "long",
"var_name": "PAGE_ID"
},
{
"declarator": "pageRenderer",
"modifier": "@Mock",
"original_string": "... | {
"body": "@Test\n public void should_display_customPage() throws Exception {\n when(hsRequest.getPathInfo()).thenReturn(\"/process/processName/processVersion/content/\");\n when(pageMappingService.getPage(hsRequest, apiSession, \"process/processName/processVersion\", locale, true)).thenReturn(new Pa... | {
"fields": [
{
"declarator": "serialVersionUID = 2789496969243916444L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2789496969243916444L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOGGE... | {
"body": "@Override\n protected void service(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n final String pathInfo = request.getPathInfo();\n\n if (!pathInfo.contains(RESOURCE_PATH_SEPARATOR + \"/\") && pathInfo.indexOf(API_PATH_SEPARATO... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_630 | {
"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_does_not_starts_with_custom_page_prefix() {\n assertThat(pageDatastore.isPageTokenValid(\"WrongStartString\" + PageDatastore.PAGE_TOKEN_PREFIX + \"suffixx\")).isFalse();\n }",
"class_method_signature": "PageDatastoreTes... | {
"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_325 | {
"fields": [
{
"declarator": "applicationAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ApplicationAPI applicationAPI;",
"type": "ApplicationAPI",
"var_name": "applicationAPI"
},
{
"declarator": "tenantFolder",
"modifier": "@Mock\n... | {
"body": "@Test\n public void should_AlreadyExistsExceptionMessage_talk_about_application() throws Exception {\n final AlreadyExistsException alreadyExistsException = new AlreadyExistsException(\"name\", \"token\");\n assertEquals(spiedApplicationImportService.getAlreadyExistsExceptionMessage(alread... | {
"fields": [
{
"declarator": "TOKEN = \"/application/import\"",
"modifier": "public final static",
"original_string": "public final static String TOKEN = \"/application/import\";",
"type": "String",
"var_name": "TOKEN"
},
{
"declarator": "FILE_UPLOAD = \"applicationsDa... | {
"body": "@Override\n protected String getAlreadyExistsExceptionMessage(final AlreadyExistsException e) {\n return _(\"Can't import applications. An application '%token%' already exists\", getLocale(), new Arg(\"token\", e.getName()));\n }",
"class_method_signature": "ApplicationsImportService.getAlre... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_775 | {
"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_case() throws Exception {\n //given\n final Map<String, Serializable> context = new HashMap<String, Serializable>();\n String engineResult = \"object returned by engine\";\n\n conte... | {
"fields": [
{
"declarator": "ARCHIVED_CASE_ID = \"archivedCaseId\"",
"modifier": "static final",
"original_string": "static final String ARCHIVED_CASE_ID = \"archivedCaseId\";",
"type": "String",
"var_name": "ARCHIVED_CASE_ID"
},
{
"declarator": "processAPI",
"m... | {
"body": "private Serializable getContextResultElement(Serializable executionContextElementValue) {\n return resourceHandler.getContextResultElement(executionContextElementValue);\n }",
"class_method_signature": "ArchivedCaseContextResource.getContextResultElement(Serializable executionContextElementValu... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_667 | {
"fields": [
{
"declarator": "groupAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private GroupAPI groupAPI;",
"type": "GroupAPI",
"var_name": "groupAPI"
},
{
"declarator": "groupEngineClient",
"modifier": "private",
"original_string... | {
"body": "@Test\n public void get_get_a_group_in_engine_repository() throws Exception {\n \n groupEngineClient.get(1L);\n \n verify(groupAPI).getGroup(1L);\n }",
"class_method_signature": "GroupEngineClientTest.get_get_a_group_in_engine_repository()",
"constructor": false,
"fu... | {
"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_237 | {
"fields": [
{
"declarator": "DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L",
"modifier": "public static final",
"original_string": "public static final long DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L;",
"type": "long",
"var_name": "DATE_01_01_1970_13H_AS_LONG_GMT"
},
{
... | {
"body": "@Test\n public void getProcessedInputs_with_multiple_complex_input_should_return_processed_input_with_null() throws Exception {\n final List<InputDefinition> inputDefinition = generateComplexInputDefinition();\n when(contractDefinition.getInputs()).thenReturn(inputDefinition);\n fin... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ContractTypeConverter.class.getName())",
"modifier": "protected static final",
"original_string": "protected static final Logger LOGGER = Logger.getLogger(ContractTypeConverter.class.getName());",
"type": "Logger",
"var_name": ... | {
"body": "public Map<String, Serializable> getProcessedInput(final ContractDefinition processContract, final Map<String, Serializable> inputs,\n final long maxSizeForTenant, final long tenantId) throws FileNotFoundException {\n this.maxSizeForTenant = maxSizeForTenant;\n this.tenantId = tena... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_722 | {
"fields": [
{
"declarator": "RETURN_VALUE = \"{'return':'value'}\"",
"modifier": "public static final",
"original_string": "public static final String RETURN_VALUE = \"{'return':'value'}\";",
"type": "String",
"var_name": "RETURN_VALUE"
},
{
"declarator": "GET = \"GET... | {
"body": "@Test\n public void should_handle_return_500_error_when_exception_is_thrown() throws Exception {\n //given\n method = new Method(GET);\n doReturn(method).when(request).getMethod();\n final BonitaException bonitaException = new BonitaException(\"error message\");\n doTh... | {
"fields": [
{
"declarator": "EMPTY_RESPONSE = \"\"",
"modifier": "public static final",
"original_string": "public static final String EMPTY_RESPONSE = \"\";",
"type": "String",
"var_name": "EMPTY_RESPONSE"
},
{
"declarator": "restApiRenderer",
"modifier": "priv... | {
"body": "@Override\n public Representation doHandle() {\n final StringRepresentation stringRepresentation = new StringRepresentation(EMPTY_RESPONSE);\n try {\n final RestApiResponse restApiResponse = handleRequest();\n fillAllContent(stringRepresentation, restApiResponse);\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_688 | {
"fields": [
{
"declarator": "businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder()",
"modifier": "private",
"original_string": "private BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder();",
"type":... | {
"body": "@Test\n public void should_handle_multiple_business_data() throws Exception {\n //given\n MultipleBusinessDataReferenceImpl bizDataRef = new MultipleBusinessDataReferenceImpl(\"Ticket\", \"com.acme.object.Ticket\", Arrays.asList(7L, 8L));\n\n //when\n boolean handlesResource ... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceResourceFinder.java",
"identifier": "BusinessDataReferenceResourceFinder",
"interfaces": "",
"methods": [
{
"class_method_signature": "BusinessDataReferenceResourceFinder.create(final Request re... | {
"body": "@Override\n public boolean handlesResource(Serializable object) {\n return object instanceof BusinessDataReference;\n }",
"class_method_signature": "BusinessDataReferenceResourceFinder.handlesResource(Serializable object)",
"constructor": false,
"full_signature": "@Override public boolea... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_372 | {
"fields": [
{
"declarator": "hsRequest",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest hsRequest;",
"type": "HttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse",
"modifier": "@Mock",
"original_string": "@Mo... | {
"body": "@Test\n public void should_redirectToValidPageUrl_on_missing_final_slash_after_appToken() throws Exception {\n doReturn(\"/appToken\").when(hsRequest).getPathInfo();\n\n servlet.service(hsRequest, hsResponse);\n\n verify(customPageRequestModifier).redirectToValidPageUrl(hsRequest, h... | {
"fields": [
{
"declarator": "serialVersionUID = -3911437607969651000L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -3911437607969651000L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOG... | {
"body": "@Override\n protected void service(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse)\n throws ServletException, IOException {\n\n final APISession session = getSession(hsRequest);\n\n // Check if requested URL is missing final slash (necessary in order to... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_558 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private CaseDocumentDatastore documentDatastore;",
"type": "CaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"modifier": "@Moc... | {
"body": "@Test(expected = APIException.class)\n public void it_throws_an_exception_when_cannot_write_file_on_update() throws IOException {\n // Given\n final Map<String, String> attributes = new HashMap<>();\n attributes.put(CaseDocumentItem.ATTRIBUTE_UPLOAD_PATH, \"C:\\\\doc.jpg\");\n\n ... | {
"fields": [
{
"declarator": "constants",
"modifier": "protected final",
"original_string": "protected final WebBonitaConstantsUtils constants;",
"type": "WebBonitaConstantsUtils",
"var_name": "constants"
},
{
"declarator": "processAPI",
"modifier": "protected fi... | {
"body": "@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_108 | {
"fields": [
{
"declarator": "processFormService",
"modifier": "@Spy",
"original_string": "@Spy\n ProcessFormService processFormService;",
"type": "ProcessFormService",
"var_name": "processFormService"
},
{
"declarator": "processAPI",
"modifier": "@Mock",
... | {
"body": "@Test\n public void getTaskInstanceId_with_taskInstanceId() throws Exception {\n final HumanTaskInstance humanTaskInstance = mock(HumanTaskInstance.class);\n when(humanTaskInstance.getId()).thenReturn(1L);\n final List<HumanTaskInstance> result = new ArrayList<HumanTaskInstance>();\... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public long getTaskInstanceId(final APISession apiSession, final long processInstanceId, final String taskName, final long userId)\n throws BonitaException {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n long ensuredUserId;\n if (userId != -1L) {\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_221 | {
"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 getFilenameLastSegment_should_return_proper_filename() {\n // given\n final String filename = \"C:\\\\Users\\\\Desktop\\\\process.bar\";\n\n // when\n final String filenameLastSegment = fileUploadServlet.getFilenameLastSegment(filename);\n\n // then... | {
"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 getFilenameLastSegment(final String fileName) {\n int slashPos = fileName.lastIndexOf(\"/\");\n if (slashPos == -1) {\n slashPos = fileName.lastIndexOf(\"\\\\\");\n }\n return fileName.substring(slashPos+1);\n }",
"class_method_signature": "FileU... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_671 | {
"fields": [
{
"declarator": "groupAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private GroupAPI groupAPI;",
"type": "GroupAPI",
"var_name": "groupAPI"
},
{
"declarator": "groupEngineClient",
"modifier": "private",
"original_string... | {
"body": "@Test\n public void update_update_a_group_in_engine_repository() throws Exception {\n GroupUpdater groupUpdater = new GroupUpdater();\n \n groupEngineClient.update(1L, groupUpdater);\n \n verify(groupAPI).updateGroup(1L, groupUpdater);\n }",
"class_method_signatur... | {
"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 update(long groupId, GroupUpdater groupUpdater) {\n try {\n return groupAPI.updateGroup(groupId, groupUpdater);\n } catch (GroupNotFoundException e) {\n throw new APIException(new _(\"Can't update group. Group not found\"));\n } catch (UpdateException... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_364 | {
"fields": [
{
"declarator": "LAYOUT_PAGE_NAME = \"layoutPageName\"",
"modifier": "public static final",
"original_string": "public static final String LAYOUT_PAGE_NAME = \"layoutPageName\";",
"type": "String",
"var_name": "LAYOUT_PAGE_NAME"
},
{
"declarator": "hsReque... | {
"body": "@Test\n public void should_not_authorize_API_requests_to_other_paths() throws Exception {\n accessAuthorizedPage(\"HumanResources\", \"API\");\n String unauthorizedPath = \"/API/living/../../WEB-INF/web.xml\";\n given(hsRequest.getPathInfo()).willReturn(\"/HumanResources\" + unautho... | {
"fields": [
{
"declarator": "applicationModelFactory",
"modifier": "private final",
"original_string": "private final ApplicationModelFactory applicationModelFactory;",
"type": "ApplicationModelFactory",
"var_name": "applicationModelFactory"
},
{
"declarator": "bonita... | {
"body": "public void route(final HttpServletRequest hsRequest, final HttpServletResponse hsResponse, final APISession session, final PageRenderer pageRenderer,\n final ResourceRenderer resourceRenderer, final BonitaHomeFolderAccessor bonitaHomeFolderAccessor)\n throws CreationException, Bonita... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_734 | {
"fields": [
{
"declarator": "getter",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private DatastoreHasGet<UserItem> getter;",
"type": "DatastoreHasGet<UserItem>",
"var_name": "getter"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/api... | {
"body": "@Test\n public void testDeployableAttributeIsDeployed() throws Exception {\n UserItem user = prepareGetterToReturnAUser();\n ReportItem report = aReportInstalledBy(APIID.makeAPIID(6L));\n\n UserDeployer installedByDeployer = new UserDeployer(getter, ReportItem.ATTRIBUTE_INSTALLED_BY... | {
"fields": [
{
"declarator": "getter",
"modifier": "private final",
"original_string": "private final DatastoreHasGet<UserItem> getter;",
"type": "DatastoreHasGet<UserItem>",
"var_name": "getter"
},
{
"declarator": "attribute",
"modifier": "private final",
... | {
"body": "@Override\n public void deployIn(IItem item) {\n if (isDeployable(attribute, item)) {\n item.setDeploy(attribute, getUser(getUserId(item)));\n }\n }",
"class_method_signature": "UserDeployer.deployIn(IItem item)",
"constructor": false,
"full_signature": "@Override publi... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_626 | {
"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 it_throws_an_exception_when_cannot_write_file_on_update() throws IOException, PageNotFoundException {\n // Given\n final Map<String, String> attributes = new HashMap<>();\n attributes.put(PageDatastore.UNMAPPED_ATTRIBUTE_ZIP_FILE, \"error_page.zip\");\n\n ... | {
"fields": [
{
"declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"",
"modifier": "public static final",
"original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";",
"type": "String",
"var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE"
},
{
"de... | {
"body": "@Override\n public PageItem update(final APIID id, final Map<String, String> attributes) {\n PageItem updatedPage = null;\n final PageUpdater pageUpdater = new PageUpdater();\n try {\n\n File zipFile = null;\n final String oldURLToken = pageAPI.getPage(id.toLon... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_276 | {
"fields": [
{
"declarator": "MY_PROFILE = \"myProfile\"",
"modifier": "public static final",
"original_string": "public static final String MY_PROFILE = \"myProfile\";",
"type": "String",
"var_name": "MY_PROFILE"
},
{
"declarator": "pageContextHelper",
"modifier... | {
"body": "@Test\n public void should_getCurrentLocale_return_cookie_locale() throws Exception {\n //given\n Cookie[] cookieList = new Cookie[1];\n cookieList[0] = new Cookie(LocaleUtils.LOCALE_COOKIE_NAME, locale.getLanguage());\n\n doReturn(null).when(request).getParameter(LocaleUtils... | {
"fields": [
{
"declarator": "PROFILE_PARAM = \"profile\"",
"modifier": "public static final",
"original_string": "public static final String PROFILE_PARAM = \"profile\";",
"type": "String",
"var_name": "PROFILE_PARAM"
},
{
"declarator": "ATTRIBUTE_API_SESSION = \"apiS... | {
"body": "public Locale getCurrentLocale() {\n return LocaleUtils.getUserLocale(request);\n }",
"class_method_signature": "PageContextHelper.getCurrentLocale()",
"constructor": false,
"full_signature": "public Locale getCurrentLocale()",
"identifier": "getCurrentLocale",
"invocations": [
"get... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_299 | {
"fields": [
{
"declarator": "customPageDependenciesResolver",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private CustomPageDependenciesResolver customPageDependenciesResolver;",
"type": "CustomPageDependenciesResolver",
"var_name": "customPageDependenciesResol... | {
"body": "@Test\n public void should_not_add_duplicated_bdm_dependencies_in_lib_folder_in_classloader() throws Exception {\n classLoader = newClassloader();\n when(customPageDependenciesResolver.resolveCustomPageDependencies())\n .thenReturn(loadedResources(\"util.jar\", \"bdm-model.jar\", \"... | {
"fields": [
{
"declarator": "nonJarResources = new HashMap<>()",
"modifier": "protected",
"original_string": "protected Map<String, byte[]> nonJarResources = new HashMap<>();",
"type": "Map<String, byte[]>",
"var_name": "nonJarResources"
},
{
"declarator": "isActive =... | {
"body": "public void addCustomPageResources() throws IOException {\n addBDMDependencies();\n addOtherDependencies();\n }",
"class_method_signature": "CustomPageChildFirstClassLoader.addCustomPageResources()",
"constructor": false,
"full_signature": "public void addCustomPageResources()",
"i... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_763 | {
"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_case() throws Exception {\n //given\n final Map<String, Serializable> context = new HashMap<String, Serializable>();\n String engineResult = \"object returned by engine\";\n\n context.put(\"... | {
"fields": [
{
"declarator": "CASE_ID = \"caseId\"",
"modifier": "static final",
"original_string": "static final String CASE_ID = \"caseId\";",
"type": "String",
"var_name": "CASE_ID"
},
{
"declarator": "processAPI",
"modifier": "private final",
"original_... | {
"body": "private Serializable getContextResultElement(Serializable executionContextElementValue) {\n return resourceHandler.getContextResultElement(executionContextElementValue);\n }",
"class_method_signature": "CaseContextResource.getContextResultElement(Serializable executionContextElementValue)",
"... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_333 | {
"fields": [
{
"declarator": "aMenuLink",
"modifier": "",
"original_string": "ApplicationMenuImpl aMenuLink;",
"type": "ApplicationMenuImpl",
"var_name": "aMenuLink"
},
{
"declarator": "aMenuContainer",
"modifier": "",
"original_string": "ApplicationMenuImp... | {
"body": "@Test\n public void should_create_an_empty_MenuContainer() throws Exception {\n MenuFactory factory = new MenuFactory(applicationApi);\n\n assertThat(factory.create(asList((ApplicationMenu) aMenuContainer)).get(0).getHtml())\n .isEqualTo(new StringBuilder()\n ... | {
"fields": [
{
"declarator": "applicationApi",
"modifier": "private final",
"original_string": "private final ApplicationAPI applicationApi;",
"type": "ApplicationAPI",
"var_name": "applicationApi"
}
],
"file": "server/src/main/java/org/bonitasoft/livingapps/menu/MenuFactory... | {
"body": "public List<Menu> create(final List<ApplicationMenu> menuList) throws ApplicationPageNotFoundException, SearchException {\n return collect(menuList, new RootMenuCollector());\n }",
"class_method_signature": "MenuFactory.create(final List<ApplicationMenu> menuList)",
"constructor": false,
"f... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_124 | {
"fields": [
{
"declarator": "processFormService",
"modifier": "@Spy",
"original_string": "@Spy\n ProcessFormService processFormService;",
"type": "ProcessFormService",
"var_name": "processFormService"
},
{
"declarator": "processAPI",
"modifier": "@Mock",
... | {
"body": "@Test\n public void isAllowedAsAdminOrProcessSupervisor_should_return_true_if_admin() throws Exception {\n final long processDefinitionId = 2L;\n final Set<String> userPermissions = new HashSet<String>();\n userPermissions.add(ProcessFormService.PROCESS_DEPLOY);\n when(httpSe... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public boolean isAllowedAsAdminOrProcessSupervisor(final HttpServletRequest request, final APISession apiSession, final long processDefinitionId,\n final long taskInstanceId, final long userId, final boolean assignTask) throws BonitaException {\n if (isLoggedUserAdmin(request) || isLogged... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_574 | {
"fields": [
{
"declarator": "processDatastore",
"modifier": "private",
"original_string": "private ProcessDatastore processDatastore;",
"type": "ProcessDatastore",
"var_name": "processDatastore"
},
{
"declarator": "engineSession",
"modifier": "@Mock\n private... | {
"body": "@Test(expected = APIException.class)\n public void it_throws_an_exception_adding_a_bar_file_with_ioException() throws IOException {\n // Given\n doThrow(new IOException(\"\")).when(tenantFolder).getTempFile(any(String.class), any(Long.class));\n\n\n // When\n try {\n ... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ProcessDatastore.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ProcessDatastore.class.getName());",
"type": "Logger",
"var_name": "logger"
}... | {
"body": "@Override\n public ProcessItem add(final ProcessItem process) {\n final ProcessEngineClient engineClient = getProcessEngineClient();\n\n File processFile;\n try {\n processFile = getTenantFolder().getTempFile(process.getAttributes().get(FILE_UPLOAD), getEngineSession().ge... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_827 | {
"fields": [
{
"declarator": "tenantResource",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private TenantResource tenantResource;",
"type": "TenantResource",
"var_name": "tenantResource"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/a... | {
"body": "@Test\n public void should_format_lastUpdateDate_as_ISO8601_string_when_tenantResourceItem_is_created(){\n String dateAsString = \"2018-01-05T09:04:19Z\";\n Instant instant = Instant.ofEpochSecond(1515143059);\n when(tenantResource.getLastUpdateDate()).thenReturn(OffsetDateTime.ofIn... | {
"fields": [
{
"declarator": "serialVersionUID = -2269943868521108237L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -2269943868521108237L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "id"... | {
"body": "public String getLastUpdateDate() {\n return lastUpdateDate;\n }",
"class_method_signature": "TenantResourceItem.getLastUpdateDate()",
"constructor": false,
"full_signature": "public String getLastUpdateDate()",
"identifier": "getLastUpdateDate",
"invocations": [],
"modifiers": "publi... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_25 | {
"fields": [
{
"declarator": "util = new FormFieldValuesUtil()",
"modifier": "",
"original_string": "FormFieldValuesUtil util = new FormFieldValuesUtil();",
"type": "FormFieldValuesUtil",
"var_name": "util"
}
],
"file": "forms/forms-server/src/test/java/org/bonitasoft/forms/... | {
"body": "@Test\n public void testStoreWidgetsInCacheAndSetCacheID() {\n final List<FormWidget> formWidgets = new ArrayList<FormWidget>();\n final FormWidget widget1 = new FormWidget();\n widget1.setId(\"widget1\");\n formWidgets.add(widget1);\n final Date processDeploymentDate ... | {
"fields": [
{
"declarator": "INDEX_SEPARATOR = \"_\"",
"modifier": "protected static final",
"original_string": "protected static final String INDEX_SEPARATOR = \"_\";",
"type": "String",
"var_name": "INDEX_SEPARATOR"
},
{
"declarator": "WIDGET_LABEL = \"label\"",
... | {
"body": "public void storeWidgetsInCacheAndSetCacheID(final long tenantID, final String formID, final String pageID, final String locale,\n final Date processDeployementDate, final List<FormWidget> formWidgets) {\n\n final FormCacheUtil formCacheUtil = FormCacheUtilFactory.getTenantFormCacheUtil(t... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_431 | {
"fields": [
{
"declarator": "applicationAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ApplicationAPI applicationAPI;",
"type": "ApplicationAPI",
"var_name": "applicationAPI"
},
{
"declarator": "pageAPI",
"modifier": "@Mock\n p... | {
"body": "@Test\n public void should_return_application_created_by_ApplicationAPI_converted_to_ApplicationItem_on_add() throws Exception {\n //given\n final ApplicationCreator creator = new ApplicationCreator(\"app\", \"My application\", \"1.0\");\n ApplicationItem app = new ApplicationItem()... | {
"fields": [
{
"declarator": "applicationAPI",
"modifier": "private final",
"original_string": "private final ApplicationAPI applicationAPI;",
"type": "ApplicationAPI",
"var_name": "applicationAPI"
},
{
"declarator": "converter",
"modifier": "private final",
... | {
"body": "@Override\n public ApplicationItem add(final ApplicationItem item) {\n\n try {\n final Page homePageDef = pageAPI.getPageByName(CUSTOMPAGE_HOME);\n\n final ApplicationCreator creator = converter.toApplicationCreator(item);\n\n final Application application = 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_718 | {
"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_return_emptyList_when_parameter_does_not_exist() throws Exception {\n //given\n final CommonResource resource = spy(new CommonResource());\n final Form form = new Form(\"f=a=b&f=c=d,e\");\n given(resource.getQuery()).willReturn(f... | {
"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_348 | {
"fields": [
{
"declarator": "applicationApi",
"modifier": "@Mock",
"original_string": "@Mock\n ApplicationAPI applicationApi;",
"type": "ApplicationAPI",
"var_name": "applicationApi"
},
{
"declarator": "pageApi",
"modifier": "@Mock",
"original_string": ... | {
"body": "@Test\n public void should_hasPage_return_true() throws Exception {\n given(applicationApi.getApplicationPage(\"token\", \"pageToken\")).willReturn(new ApplicationPageImpl(1, 1, \"pageToken\"));\n\n assertThat(model.hasPage(\"pageToken\")).isEqualTo(true);\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "profileApi",
"modifier": "private final",
"original_string": "private final ProfileAPI profileApi;",
"type": "ProfileAPI",
"var_name": "profileApi"
},
{
"declarator": "applicationApi",
"modifier": "private final",
"original_str... | {
"body": "public boolean hasPage(final String pageToken) {\n try {\n applicationApi.getApplicationPage(application.getToken(), pageToken);\n return true;\n } catch (final ApplicationPageNotFoundException e) {\n return false;\n }\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_870 | {
"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 deserializeList_can_deserialize_primitives_types() throws Exception {\n\n List<Long> longs = jacksonDeserializer.deserializeList(\"[1, 2, 3]\", Long.class);\n\n assertThat(longs, hasItems(1L, 2L, 3L));\n }",
"class_method_signature": "JacksonDeserializerTest.deseri... | {
"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_523 | {
"fields": [
{
"declarator": "session",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private APISession session;",
"type": "APISession",
"var_name": "session"
},
{
"declarator": "applicationAPI",
"modifier": "@Mock\n private",
"origin... | {
"body": "@Test\n public void should_delete_the_good_Application_Page_on_delete() throws Exception {\n //given\n\n //when\n dataStore.delete(Arrays.<APIID> asList(APIID.makeAPIID(\"1\"), APIID.makeAPIID(\"2\")));\n\n //then\n verify(applicationAPI, times(1)).deleteApplicationPag... | {
"fields": [
{
"declarator": "applicationAPI",
"modifier": "private final",
"original_string": "private final ApplicationAPI applicationAPI;",
"type": "ApplicationAPI",
"var_name": "applicationAPI"
},
{
"declarator": "pageAPI",
"modifier": "private final",
... | {
"body": "@Override\n public void delete(final List<APIID> ids) {\n try {\n for (final APIID id : ids) {\n applicationAPI.deleteApplicationPage(id.toLong());\n }\n } catch (final Exception e) {\n throw new APIException(e);\n }\n }",
"class_... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_489 | {
"fields": [
{
"declarator": "profileClient",
"modifier": "@Mock",
"original_string": "@Mock\n ProfileEngineClient profileClient;",
"type": "ProfileEngineClient",
"var_name": "profileClient"
},
{
"declarator": "getProfileHelper",
"modifier": "",
"origina... | {
"body": "@Test\n public void testWeCanRetrieveAProfile() throws Exception {\n final Profile aKnownProfile = anEngineProfile().withName(\"aName\").withDescription(\"aDescription\").build();\n when(profileClient.getProfile(1L)).thenReturn(aKnownProfile);\n\n final ProfileItem item = getProfile... | {
"fields": [
{
"declarator": "profileClient",
"modifier": "private",
"original_string": "private ProfileEngineClient profileClient;",
"type": "ProfileEngineClient",
"var_name": "profileClient"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/profil... | {
"body": "@Override\n public ProfileItem get(APIID id) {\n Profile profile = profileClient.getProfile(id.toLong());\n return new ProfileItemConverter().convert(profile);\n }",
"class_method_signature": "GetProfileHelper.get(APIID id)",
"constructor": false,
"full_signature": "@Override publ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_173 | {
"fields": [
{
"declarator": "request",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest request;",
"type": "HttpServletRequest",
"var_name": "request"
},
{
"declarator": "requestAccessor",
"modifier": "@Mock",
"original_string": "@Moc... | {
"body": "@Test\n public void testtSanitizeLoginPageUrlFromMaliciousRedirectShouldReturnBrokenUrl() throws Exception {\n try {\n logoutServlet.sanitizeLoginPageUrl(\"http://www.test.com\");\n fail(\"building a login page with a different host on the redirectURL should fail\");\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 739607235407639011L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 739607235407639011L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOGIN_P... | {
"body": "protected String sanitizeLoginPageUrl(final String loginURL) {\n return new RedirectUrlBuilder(new URLProtector().protectRedirectUrl(loginURL)).build().getUrl();\n }",
"class_method_signature": "LogoutServlet.sanitizeLoginPageUrl(final String loginURL)",
"constructor": false,
"full_signatur... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_466 | {
"fields": [
{
"declarator": "converter = new ApplicationMenuSearchDescriptorConverter()",
"modifier": "private final",
"original_string": "private final ApplicationMenuSearchDescriptorConverter converter = new ApplicationMenuSearchDescriptorConverter();",
"type": "ApplicationMenuSearchDe... | {
"body": "@Test\n public void should_return_ApplicationMenuSearchDescriptor_index_on_convert_attribute_menu_index() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationMenuItem.ATTRIBUTE_MENU_INDEX);\n\n //then\n assertThat(convertedValue).isEqualTo... | {
"fields": [
{
"declarator": "mapping",
"modifier": "private final",
"original_string": "private final Map<String, String> mapping;",
"type": "Map<String, String>",
"var_name": "mapping"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationm... | {
"body": "@Override\n public String convert(final String attribute) {\n return MapUtil.getMandatory(mapping, attribute);\n }",
"class_method_signature": "ApplicationMenuSearchDescriptorConverter.convert(final String attribute)",
"constructor": false,
"full_signature": "@Override public String conv... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_72 | {
"fields": [
{
"declarator": "request",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequest request;",
"type": "HttpServletRequest",
"var_name": "request"
}
],
"file": "common/src/test/java/org/bonitasoft/console/common/server/utils/Lo... | {
"body": "@Test\n public void testANullCookieAndBrowserLocaleResultsWithDefaultLocale() throws Exception {\n\n String locale = LocaleUtils.getUserLocaleAsString(request);\n\n assertEquals(\"en\", locale);\n }",
"class_method_signature": "LocaleUtilsTest.testANullCookieAndBrowserLocaleResultsWit... | {
"fields": [
{
"declarator": "LOCALE_PARAM = \"locale\"",
"modifier": "public static final",
"original_string": "public static final String LOCALE_PARAM = \"locale\";",
"type": "String",
"var_name": "LOCALE_PARAM"
},
{
"declarator": "PORTAL_LOCALE_PARAM = \"_l\"",
... | {
"body": "public static String getUserLocaleAsString(final HttpServletRequest request) {\n String locale = getLocaleFromRequestURL(request);\n if (locale == null) {\n locale = getStandardizedLocaleFromCookie(request);\n }\n if (locale == null) {\n String browserLocal... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_165 | {
"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_autologin_not_available_for_the_requested_process_and_tenant() throws Exception{\n when(configurationFilesManager.getTenantAutoLoginConfiguration(TENANT_ID)).thenReturn(autoLoginConfiguration);\n\n AutoLoginCredentials autoLoginCre... | {
"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_535 | {
"fields": [
{
"declarator": "datastore",
"modifier": "private",
"original_string": "private ArchivedCaseDatastore datastore;",
"type": "ArchivedCaseDatastore",
"var_name": "datastore"
},
{
"declarator": "processAPI",
"modifier": "@Mock\n private",
"orig... | {
"body": "@Test\n public void should_delete_all_archived_cases_when_one_id_is_given() throws DeletionException, ProcessInstanceNotFoundException,\n ArchivedProcessInstanceNotFoundException {\n //given\n final List<APIID> idList = Collections.singletonList(APIID.makeAPIID(archivedProcessIn... | {
"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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.