id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
11337147_741 | {
"fields": [
{
"declarator": "client",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProfileEntryEngineClient client;",
"type": "ProfileEntryEngineClient",
"var_name": "client"
},
{
"declarator": "entry1",
"modifier": "@Mock\n privat... | {
"body": "@Test\n public void should_return_all_page_tokens_for_each_profile_entries() throws Exception {\n given(entry1.getPage()).willReturn(\"token 1\");\n given(entry2.getPage()).willReturn(\"token 2\");\n\n TokenProfileProvider provider = new TokenProfileProvider(Arrays.asList(\n ... | {
"fields": [
{
"declarator": "tokens = new ArrayList<String>()",
"modifier": "private",
"original_string": "private List<String> tokens = new ArrayList<String>();",
"type": "List<String>",
"var_name": "tokens"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server... | {
"body": "@Override\n public List<String> getTokens() {\n return tokens;\n }",
"class_method_signature": "TokenProfileProvider.getTokens()",
"constructor": false,
"full_signature": "@Override public List<String> getTokens()",
"identifier": "getTokens",
"invocations": [],
"modifiers": "@Overr... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_311 | {
"fields": [
{
"declarator": "req",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequest req;",
"type": "HttpServletRequest",
"var_name": "req"
},
{
"declarator": "res",
"modifier": "@Mock\n private",
"original_stri... | {
"body": "@Test\n public void getPathSegments_should_return_expected_token_list_ondouble_slash() throws UnsupportedEncodingException {\n when(req.getPathInfo()).thenReturn(\"a//b\");\n\n final List<String> tokens = resourceRenderer.getPathSegments(\"a//b\");\n assertThat(tokens).hasSize(2).co... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ResourceRenderer.class.getName())",
"modifier": "private final static",
"original_string": "private final static Logger LOGGER = Logger.getLogger(ResourceRenderer.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public List<String> getPathSegments(final String pathInfo) throws UnsupportedEncodingException {\n final List<String> segments = new ArrayList<>();\n if (pathInfo != null) {\n for (final String segment : pathInfo.split(\"/\")) {\n if (!segment.isEmpty()) {\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_595 | {
"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_should_skip_empty_icon() throws Exception {\n //given\n HashMap<String, String> attributes = new HashMap<>();\n attributes.put(GroupItem.ATTRIBUTE_ICON, \"\");\n attributes.put(GroupItem.ATTRIBUTE_NAME, \"aNewName\");\n\n //when\n Gro... | {
"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_829 | {
"fields": [
{
"declarator": "converter = new CustomUserInfoConverter()",
"modifier": "private",
"original_string": "private CustomUserInfoConverter converter = new CustomUserInfoConverter();",
"type": "CustomUserInfoConverter",
"var_name": "converter"
}
],
"file": "server/s... | {
"body": "@Test\n public void should_return_a_fully_configured_custom_information() throws Exception {\n CustomUserInfoDefinition definition = new EngineCustomUserInfoDefinition(3L);\n CustomUserInfoValueImpl value = new CustomUserInfoValueImpl();\n value.setValue(\"foo\");\n\n CustomU... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/organization/CustomUserInfoConverter.java",
"identifier": "CustomUserInfoConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "CustomUserInfoConverter.convert(CustomUserInfoDefinition definition)",
... | {
"body": "public CustomUserInfoDefinitionItem convert(CustomUserInfoDefinition definition) {\n CustomUserInfoDefinitionItem item = new CustomUserInfoDefinitionItem();\n item.setId(APIID.makeAPIID(definition.getId()));\n item.setName(definition.getName());\n item.setDescription(definition.... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_203 | {
"fields": [
{
"declarator": "ICON_ID = 1238970432L",
"modifier": "private static final",
"original_string": "private static final long ICON_ID = 1238970432L;",
"type": "long",
"var_name": "ICON_ID"
},
{
"declarator": "iconServlet",
"modifier": "@Spy\n private... | {
"body": "@Test\n public void should_return_icon_content_when_valid_icon_id_is_given() throws Exception {\n havingIcon(ICON_ID, \"content\".getBytes());\n httpServletRequest.setPathInfo(\"/\" + String.valueOf(ICON_ID));\n\n iconServlet.doGet(httpServletRequest, httpServletResponse);\n\n ... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOGGER = Logger.getLogger(IconServlet.cla... | {
"body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {\n String iconIdPath = request.getPathInfo();\n if (iconIdPath == null || iconIdPath.isEmpty()) {\n response.setStatus(HttpServletResponse.SC_BAD_REQUE... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_653 | {
"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 delete_throw_APIException_if_exception_occur_when_deleting_users_in_engine_repository() throws Exception {\n List<Long> idsToBeDeleted = asList(1L, 2L);\n doThrow(new DeletionException(\"aMessage\")).when(identityAPI).deleteUsers(idsToBeDe... | {
"fields": [
{
"declarator": "identityAPI",
"modifier": "private",
"original_string": "private IdentityAPI identityAPI;",
"type": "IdentityAPI",
"var_name": "identityAPI"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/UserEngineClient.java",
... | {
"body": "public void delete(List<Long> userIds) {\n try {\n identityAPI.deleteUsers(userIds);\n } catch (DeletionException e) {\n throw new APIException(new _(\"Error when deleting users\"), e);\n }\n }",
"class_method_signature": "UserEngineClient.delete(List<Long> u... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_346 | {
"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_getApplicationLayoutName_return_valide_name() throws Exception {\n given(page.getName()).willReturn(\"layoutPage\");\n given(pageApi.getPage(1L)).willReturn(page);\n\n String appLayoutName = model.getApplicationLayoutName();\n\n assertThat(appLayout... | {
"fields": [
{
"declarator": "profileApi",
"modifier": "private final",
"original_string": "private final ProfileAPI profileApi;",
"type": "ProfileAPI",
"var_name": "profileApi"
},
{
"declarator": "applicationApi",
"modifier": "private final",
"original_str... | {
"body": "public String getApplicationLayoutName() throws PageNotFoundException {\n return pageApi.getPage(application.getLayoutId()).getName();\n }",
"class_method_signature": "ApplicationModel.getApplicationLayoutName()",
"constructor": false,
"full_signature": "public String getApplicationLayoutNa... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_716 | {
"fields": [
{
"declarator": "fakeService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private FakeService fakeService;",
"type": "FakeService",
"var_name": "fakeService"
},
{
"declarator": "headers = new Series<>(Header.class)",
"modifier":... | {
"body": "@Test\n public void getParametersAsList_should_support_value_with_comma() 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(form);\n\n //whe... | {
"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_501 | {
"fields": [
{
"declarator": "profileEntryClient",
"modifier": "@Mock",
"original_string": "@Mock\n ProfileEntryEngineClient profileEntryClient;",
"type": "ProfileEntryEngineClient",
"var_name": "profileEntryClient"
},
{
"declarator": "getProfileEntryHelper",
... | {
"body": "@Test\n public void testWeCanRetrieveAProfileEntry() throws Exception {\n ProfileEntry expectedProfileEntry = anEngineProfileEntry().build();\n when(profileEntryClient.getProfileEntry(1L)).thenReturn(expectedProfileEntry);\n\n ProfileEntryItem item = getProfileEntryHelper.get(APIID.... | {
"fields": [
{
"declarator": "profileEntryClient",
"modifier": "private",
"original_string": "private ProfileEntryEngineClient profileEntryClient;",
"type": "ProfileEntryEngineClient",
"var_name": "profileEntryClient"
}
],
"file": "server/src/main/java/org/bonitasoft/web/res... | {
"body": "@Override\n public ProfileEntryItem get(APIID id) {\n ProfileEntry profileEntry = profileEntryClient.getProfileEntry(id.toLong());\n return new ProfileEntryItemConverter().convert(profileEntry);\n }",
"class_method_signature": "GetProfileEntryHelper.get(APIID id)",
"constructor": fa... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_151 | {
"fields": [
{
"declarator": "resourcesPermissionsMapping",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ResourcesPermissionsMapping resourcesPermissionsMapping;",
"type": "ResourcesPermissionsMapping",
"var_name": "resourcesPermissionsMapping"
},
... | {
"body": "@Test\n public void test_staticCheck_authorized() throws Exception {\n final Set<String> userPermissions = new HashSet<String>(Arrays.asList(\"MyPermission\", \"AnOtherPermission\"));\n final List<String> resourcePermissions = Arrays.asList(\"CasePermission\", \"AnOtherPermission\");\n ... | {
"fields": [
{
"declarator": "SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\"",
"modifier": "public static final",
"original_string": "public static final String SCRIPT_TYPE_AUTHORIZATION_PREFIX = \"check\";",
"type": "String",
"var_name": "SCRIPT_TYPE_AUTHORIZATION_PREFIX"
},
... | {
"body": "protected boolean staticCheck(final APICallContext apiCallContext, final Set<String> permissionsOfUser,\n final Set<String> resourcePermissions, final String username) {\n for (final String resourcePermission : resourcePermissions) {\n if (permissionsOfUser.contains(resourcePer... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_852 | {
"fields": [
{
"declarator": "caller",
"modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private",
"original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;",
"type": "APIServletCall",
"var_name": "caller"
},
{
"declarator": "h... | {
"body": "@Test\n public void should_paginate_CustomUserInfo_search() throws Exception {\n given(engine.countDefinitions()).willReturn(2L);\n\n api.search(2, 2, null, \"Fix order\", Collections.singletonMap(\"userId\", \"3\")).getResults();\n\n verify(engine).listCustomInformation(3L, 4, 2);\... | {
"fields": [
{
"declarator": "FIX_ORDER = \"Fix order\"",
"modifier": "public static final",
"original_string": "public static final String FIX_ORDER = \"Fix order\";",
"type": "String",
"var_name": "FIX_ORDER"
},
{
"declarator": "engineClientCreator",
"modifier"... | {
"body": "@Override\n public ItemSearchResult<CustomUserInfoItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n check(containsOnly(FILTER_USER_ID, filters), new _(\"The only mandatory filter is %name%\", new Arg(\"name\", FILTER_USER_ID)));\n chec... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_444 | {
"fields": [
{
"declarator": "STATE = ApplicationState.DEACTIVATED.name()",
"modifier": "private static final",
"original_string": "private static final String STATE = ApplicationState.DEACTIVATED.name();",
"type": "String",
"var_name": "STATE"
},
{
"declarator": "UPDA... | {
"body": "@Test\n public void applicationItem_with_null_Theme_id_should_not_return_null() throws Exception {\n //given\n final ApplicationImpl application = new ApplicationImpl(DISPLAY_NAME, VERSION, DESCRIPTION, LAYOUT_ID, null);\n application.setId(15);\n application.setDisplayName(D... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/ApplicationItemConverter.java",
"identifier": "ApplicationItemConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ApplicationItemConverter.toApplicationItem(final Application applic... | {
"body": "public ApplicationItem toApplicationItem(final Application application) {\n final ApplicationItem item = new ApplicationItem();\n item.setId(application.getId());\n item.setToken(application.getToken());\n item.setDisplayName(application.getDisplayName());\n item.setVersi... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_50 | {
"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_not_fail_when_file_is_missing() throws Exception {\n given(modifier.resolve(\"style.less\")).willReturn(new File(\"style.less\"));\n\n new CompilableFile(\"style.less\", \"style.css\").compile(modifier);\n }",
"class_method_signature": "CompilableFileTest.sh... | {
"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_297 | {
"fields": [
{
"declarator": "webBonitaConstantsUtils",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private WebBonitaConstantsUtils webBonitaConstantsUtils;",
"type": "WebBonitaConstantsUtils",
"var_name": "webBonitaConstantsUtils"
},
{
"declarator... | {
"body": "@Test\n public void should_resolve_dependencies_return_an_empty_map_if_no_lib_folder_is_found_in_custom_page() throws Exception {\n final CustomPageDependenciesResolver resolver = newCustomPageDependenciesResolver(null);\n\n final Map<String, byte[]> dependenciesContent = resolver.resolveC... | {
"fields": [
{
"declarator": "LIB_FOLDER_NAME = \"lib\"",
"modifier": "private static final",
"original_string": "private static final String LIB_FOLDER_NAME = \"lib\";",
"type": "String",
"var_name": "LIB_FOLDER_NAME"
},
{
"declarator": "PAGES_LIB_TMPDIR = new HashMap... | {
"body": "public Map<String, byte[]> resolveCustomPageDependencies() {\n final File customPageLibDirectory = new File(pageDirectory, LIB_FOLDER_NAME);\n if (customPageLibDirectory.exists()) {\n this.libTempFolder = new File(this.webBonitaConstantsUtils.getTempFolder(), pageName\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_782 | {
"fields": [
{
"declarator": "userDatastore",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private UserDatastore userDatastore;",
"type": "UserDatastore",
"var_name": "userDatastore"
},
{
"declarator": "processDatastore",
"modifier": "@Mock\n ... | {
"body": "@Test\n public final void search_should_search_case_items_on_CaseDatastore_when_supervisor_filter_is_used_without_team_manager_filter() {\n final int page = 6;\n final int resultsByPage = 10;\n final String search = \"plop\";\n final String orders = CaseItem.ATTRIBUTE_END_DAT... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/cases/APICase.java",
"identifier": "APICase",
"interfaces": "implements APIHasGet<CaseItem>, APIHasAdd<CaseItem>, APIHasSearch<CaseItem>, APIHasDelete",
"methods": [
{
"class_method_signature": "APICase.defineItemDe... | {
"body": "@Override\n public ItemSearchResult<CaseItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n // Check that team manager and supervisor filters are not used together\n if (filters.containsKey(Case... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_278 | {
"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_return_ApiSession() throws Exception {\n //given\n doReturn(httpSession).when(request).getSession();\n doReturn(apiSession).when(httpSession).getAttribute(pageContextHelper.ATTRIBUTE_API_SESSION);\n pageContextHelper = new PageContextHelper(request)... | {
"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 APISession getApiSession() {\n final HttpSession httpSession = request.getSession();\n return (APISession) httpSession.getAttribute(ATTRIBUTE_API_SESSION);\n\n }",
"class_method_signature": "PageContextHelper.getApiSession()",
"constructor": false,
"full_signature": "public AP... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_628 | {
"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_true_when_url_token_starts_with_custom_page_prefix() {\n assertThat(pageDatastore.isPageTokenValid(PageDatastore.PAGE_TOKEN_PREFIX + \"anySuffix123456\")).isTrue();\n }",
"class_method_signature": "PageDatastoreTest.should_IsPageTokenValid_... | {
"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_805 | {
"fields": [
{
"declarator": "VALID_COMPLEX_POST_BODY = \"{\\\"aBoolean\\\":true, \\\"aString\\\":\\\"hello world\\\", \\\"a_complex_type\\\":{\\\"aNumber\\\":2, \\\"aBoolean\\\":false}}\"",
"modifier": "private static final",
"original_string": "private static final String VALID_COMPLEX_POST_B... | {
"body": "@Test\n public void should_getProcessDefinitionIdParameter_throws_an_exception_when_task_id_parameter_is_null() throws Exception {\n //given\n doReturn(null).when(userTaskExecutionResource).getAttribute(UserTaskExecutionResource.TASK_ID);\n\n try {\n //when\n u... | {
"fields": [
{
"declarator": "TASK_ID = \"taskId\"",
"modifier": "static final",
"original_string": "static final String TASK_ID = \"taskId\";",
"type": "String",
"var_name": "TASK_ID"
},
{
"declarator": "USER_PARAM = \"user\"",
"modifier": "private static final"... | {
"body": "protected long getTaskIdParameter() {\n final String taskId = getAttribute(TASK_ID);\n if (taskId == null) {\n throw new APIException(\"Attribute '\" + TASK_ID + \"' is mandatory\");\n }\n return Long.parseLong(taskId);\n }",
"class_method_signature": "UserTaskEx... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_106 | {
"fields": [
{
"declarator": "processFormService",
"modifier": "@Spy",
"original_string": "@Spy\n ProcessFormService processFormService;",
"type": "ProcessFormService",
"var_name": "processFormService"
},
{
"declarator": "processAPI",
"modifier": "@Mock",
... | {
"body": "@Test\n public void getTaskName_with_taskInstanceId() throws Exception {\n final ActivityInstance activityInstance = mock(ActivityInstance.class);\n when(activityInstance.getName()).thenReturn(\"myTask\");\n when(processAPI.getActivityInstance(42L)).thenReturn(activityInstance);\n ... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public String getTaskName(final APISession apiSession, final long taskInstanceId) throws ActivityInstanceNotFoundException, BonitaException {\n if (taskInstanceId != -1L) {\n final ProcessAPI processAPI = getProcessAPI(apiSession);\n try {\n final ActivityInstanc... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_556 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private CaseDocumentDatastore documentDatastore;",
"type": "CaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"modifier": "@Moc... | {
"body": "@Test(expected = APIException.class)\n public void it_should_not_update_document_and_throws_exception_for_missing_uploadPath() {\n // Given\n final Map<String, String> attributes = new HashMap<>();\n attributes.put(CaseDocumentItem.ATTRIBUTE_NAME, \"Doc 1\");\n final APIID id... | {
"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_413 | {
"fields": [
{
"declarator": "engineSession",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private APISession engineSession;",
"type": "APISession",
"var_name": "engineSession"
},
{
"declarator": "commonDatastore",
"modifier": "@InjectMocks\n ... | {
"body": "@Test\n public void addLongFilterToSearchBuilder_should_do_nothing_when_filters_is_null() {\n // given:\n final SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 10);\n // when:\n commonDatastore.addLongFilterToSearchBuilder(null, searchOptionsBuilder, n... | {
"fields": [
{
"declarator": "engineSession",
"modifier": "private",
"original_string": "private APISession engineSession;",
"type": "APISession",
"var_name": "engineSession"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/CommonDatastore.java",
... | {
"body": "protected void addLongFilterToSearchBuilder(final Map<String, String> filters, final SearchOptionsBuilder builder, final String filterName,\n final String engineAttributeName) {\n if (filters != null && filters.containsKey(filterName)) {\n final String filterValue = filters.get... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_690 | {
"fields": [
{
"declarator": "businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder()",
"modifier": "private",
"original_string": "private BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder();",
"type":... | {
"body": "@Test\n public void should_not_handle_other_types() throws Exception {\n //when\n boolean handlesResource = businessDataReferenceResourceFinder.handlesResource(12l);\n\n //then\n assertThat(handlesResource).isFalse();\n }",
"class_method_signature": "BusinessDataReferenc... | {
"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_385 | {
"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_ProcessInstanciationResource_for_ProcessInstanciationResourceFinder() {\n final ProcessInstantiationResourceFinder processInstanciationResourceFinder = spy(new ProcessInstantiationResourceFinder());\n doReturn(processAPI).when(processInstanciationResourceF... | {
"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_540 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private ArchivedCaseDocumentDatastore documentDatastore;",
"type": "ArchivedCaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"... | {
"body": "@Test\n public void it_should_not_convert_null_item_return_null() {\n // When\n final CaseDocumentItem convertedEngineToConsoleItem = documentDatastore.convertEngineToConsoleItem(null);\n // Then\n assertTrue(convertedEngineToConsoleItem == null);\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "constants",
"modifier": "protected final",
"original_string": "protected final WebBonitaConstantsUtils constants;",
"type": "WebBonitaConstantsUtils",
"var_name": "constants"
},
{
"declarator": "processAPI",
"modifier": "protected fi... | {
"body": "@Override\n protected 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_110 | {
"fields": [
{
"declarator": "processFormService",
"modifier": "@Spy",
"original_string": "@Spy\n ProcessFormService processFormService;",
"type": "ProcessFormService",
"var_name": "processFormService"
},
{
"declarator": "processAPI",
"modifier": "@Mock",
... | {
"body": "@Test\n public void getProcessDefinitionId_with_no_version() throws Exception {\n assertEquals(-1L, processFormService.getProcessDefinitionId(apiSession, \"myProcess\", null));\n }",
"class_method_signature": "ProcessFormServiceTest.getProcessDefinitionId_with_no_version()",
"constructor":... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public long getProcessDefinitionId(final APISession apiSession, final String processName, final String processVersion)\n throws ProcessDefinitionNotFoundException, BonitaException {\n if (processName != null && processVersion != null) {\n try {\n return getProces... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_813 | {
"fields": [
{
"declarator": "processConnectorDatastore",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProcessConnectorDatastore processConnectorDatastore;",
"type": "ProcessConnectorDatastore",
"var_name": "processConnectorDatastore"
},
{
"... | {
"body": "@Test(expected = APIFilterMandatoryException.class)\n public void whenSearchingFilterProcessIdIsMandatory() throws Exception {\n this.apiProcessConnector.search(0, 10, null, null, EMPTY_MAP);\n }",
"class_method_signature": "APIProcessConnectorTest.whenSearchingFilterProcessIdIsMandatory()",... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/APIProcessConnector.java",
"identifier": "APIProcessConnector",
"interfaces": "implements\n APIHasGet<ProcessConnectorItem>,\n APIHasSearch<ProcessConnectorItem>",
"methods": [
{
"class_method_... | {
"body": "@Override\n public ItemSearchResult<ProcessConnectorItem> search(final int page, final int resultsByPage, final String search, final String orders,\n final Map<String, String> filters) {\n\n if (MapUtil.isBlank(filters, ATTRIBUTE_PROCESS_ID)) {\n throw new APIFilterMandatory... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_405 | {
"fields": [
{
"declarator": "factory",
"modifier": "",
"original_string": "BonitaRestAPIFactory factory;",
"type": "BonitaRestAPIFactory",
"var_name": "factory"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/BonitaRestAPIFactoryTest.java",
"identifier":... | {
"body": "@Test\n public void should_provide_an_APICustomUserInfoUser_when_requesting_custom_user_info() throws Exception {\n assertTrue(factory.defineApis(\"customuserinfo\", \"user\") instanceof APICustomUserInfoUser);\n }",
"class_method_signature": "BonitaRestAPIFactoryTest.should_provide_an_APICu... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(BonitaRestAPIFactory.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(BonitaRestAPIFactory.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
}
]... | {
"body": "@Override\n public API<? extends IItem> defineApis(final String apiToken, final String resourceToken) {\n \t\n if (\"identity\".equals(apiToken)) {\n if (\"user\".equals(resourceToken)) {\n return new APIUser();\n } else if (\"role\".equals(resourceToken)) ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_11 | {
"fields": [
{
"declarator": "formServiceProviderImpl",
"modifier": "@Spy",
"original_string": "@Spy\n FormServiceProviderImpl formServiceProviderImpl;",
"type": "FormServiceProviderImpl",
"var_name": "formServiceProviderImpl"
},
{
"declarator": "workflowAPI",
... | {
"body": "@Test\n public void should_canUserViewInstanceForm_return_true_for_admin() throws Exception {\n final String formId = \"formId\";\n final long userId = 2L;\n final long processInstanceId = 3L;\n\n //given\n doReturn(1L).when(formWorkflowAPIImpl).getProcessDefinitionIDF... | {
"fields": [
{
"declarator": "UI_FORM_MODE = \"form\"",
"modifier": "private static final",
"original_string": "private static final String UI_FORM_MODE = \"form\";",
"type": "String",
"var_name": "UI_FORM_MODE"
},
{
"declarator": "LOGGER",
"modifier": "protected... | {
"body": "protected void canUserViewInstanceForm(final APISession session, final User user, final IFormWorkflowAPI workflowAPI, final long processInstanceID,\n final String formId, final long userId,\n final Map<String, Object> context) throws InvalidSessionException, BPMEngineException, FormNo... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_686 | {
"fields": [
{
"declarator": "businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder()",
"modifier": "private",
"original_string": "private BusinessDataReferenceResourceFinder businessDataReferenceResourceFinder = new BusinessDataReferenceResourceFinder();",
"type":... | {
"body": "@Test\n public void should_return_a_context_of_type_MultipleBusinessDataRef_for_a_given_task_instance() throws Exception {\n //given\n MultipleBusinessDataReferenceImpl bizDataRef = new MultipleBusinessDataReferenceImpl(\"Ticket\", \"com.acme.object.Ticket\", Arrays.asList(7L, 8L));\n\n ... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataReferenceResourceFinder.java",
"identifier": "BusinessDataReferenceResourceFinder",
"interfaces": "",
"methods": [
{
"class_method_signature": "BusinessDataReferenceResourceFinder.create(final Request re... | {
"body": "@Override\n public Serializable toClientObject(Serializable object) {\n return BusinessDataReferenceResource.toClient((BusinessDataReference) object);\n }",
"class_method_signature": "BusinessDataReferenceResourceFinder.toClientObject(Serializable object)",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_239 | {
"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 should_be_able_to_convert_Integer_to_Date() throws Exception {\n\n Object conversionResult = contractTypeConverter.convertToType(Type.DATE, 86400000);\n assertThat(conversionResult).isNotNull();\n assertThat(conversionResult).isInstanceOf(Date.class);\n as... | {
"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_393 | {
"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_BusinessDataResource_for_BusinessDataResourceFinder() {\n final BusinessDataResourceFinder businessDataResourceFinder = spy(new BusinessDataResourceFinder());\n doReturn(commandAPI).when(businessDataResourceFinder).getCommandAPI(any(Request.class));\n ... | {
"fields": [
{
"declarator": "finders",
"modifier": "protected",
"original_string": "protected Map<Class<? extends ServerResource>, ResourceFinder> finders;",
"type": "Map<Class<? extends ServerResource>, ResourceFinder>",
"var_name": "finders"
},
{
"declarator": "reso... | {
"body": "public Finder create(final Class<? extends ServerResource> clazz) {\n final Finder finder = finders.get(clazz);\n if (finder == null) {\n throw new RuntimeException(\"Finder unimplemented for class \" + clazz);\n }\n return finder;\n }",
"class_method_signature":... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_669 | {
"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 delete_delete_groups_in_engine_repository() throws Exception {\n List<Long> groupIds = asList(1L, 2L);\n \n groupEngineClient.delete(groupIds);\n \n verify(groupAPI).deleteGroups(groupIds);\n }",
"class_method_signature": "GroupEngineClientTest... | {
"fields": [
{
"declarator": "groupAPI",
"modifier": "private",
"original_string": "private GroupAPI groupAPI;",
"type": "GroupAPI",
"var_name": "groupAPI"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/GroupEngineClient.java",
"identifier":... | {
"body": "public void delete(List<Long> groupIds) {\n try {\n groupAPI.deleteGroups(groupIds);\n } catch (DeletionException e) {\n throw new APIException(new _(\"Error when deleting groups\"), e);\n }\n }",
"class_method_signature": "GroupEngineClient.delete(List<Long>... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_844 | {
"fields": [
{
"declarator": "caller",
"modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private",
"original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;",
"type": "APIServletCall",
"var_name": "caller"
},
{
"declarator": "h... | {
"body": "@Test(expected = APIException.class)\n public void search_should_throw_an_exception_when_a_search_is_passed_through() throws Exception {\n api.search(0, 1, \"foo\", APICustomUserInfoDefinition.FIX_ORDER, null);\n }",
"class_method_signature": "APICustomUserInfoDefinitionTest.search_should_th... | {
"fields": [
{
"declarator": "FIX_ORDER = \"Fix order\"",
"modifier": "public static final",
"original_string": "public static final String FIX_ORDER = \"Fix order\";",
"type": "String",
"var_name": "FIX_ORDER"
},
{
"declarator": "converter = new CustomUserInfoConverte... | {
"body": "public ItemSearchResult<CustomUserInfoDefinitionItem> search(\n final int page,\n final int resultsByPage,\n final String search,\n final String orders,\n final Map<String, String> filters) {\n\n check(search == null, new _(\"Search terms are no... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_147 | {
"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_form_data() throws Exception {\n request = mockMultipartRequestFor(SESSION_CSRF_TOKEN);\n\n boolean valid = filter.checkValidCondition(request, response);\n\n assertThat(valid).isTrue();\n }",
"class_method_signature": "T... | {
"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_517 | {
"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_applicationId_on_convert_attribute_applicationId() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationPageItem.ATTRIBUTE_APPLICATION_ID);\n\n //then\n assertThat(convertedV... | {
"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_46 | {
"fields": [
{
"declarator": "req",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequest req;",
"type": "HttpServletRequest",
"var_name": "req"
},
{
"declarator": "resourceLocationReader = new ResourceLocationReader()",
"mod... | {
"body": "@Test\n public void should_use_infopath_if_location_param_is_not_defined() throws Exception {\n\n when(req.getParameter(\"location\")).thenReturn(null);\n when(req.getPathInfo()).thenReturn(\"/bonita.css\");\n\n final String resourceLocation = resourceLocationReader.getResourceLocat... | {
"fields": [
{
"declarator": "LOCATION_PARAM = \"location\"",
"modifier": "public final static",
"original_string": "public final static String LOCATION_PARAM = \"location\";",
"type": "String",
"var_name": "LOCATION_PARAM"
}
],
"file": "common/src/main/java/org/bonitasoft/c... | {
"body": "public String getResourceLocationFromRequest(final HttpServletRequest request) {\n String fileName = request.getParameter(LOCATION_PARAM);\n if (fileName == null) {\n final String pathInfo = request.getPathInfo();\n if (pathInfo != null && pathInfo.startsWith(\"/\") && p... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_452 | {
"fields": [
{
"declarator": "converter = new ApplicationSearchDescriptorConverter()",
"modifier": "private final",
"original_string": "private final ApplicationSearchDescriptorConverter converter = new ApplicationSearchDescriptorConverter();",
"type": "ApplicationSearchDescriptorConverte... | {
"body": "@Test\n public void should_return_ApplicationSearchDescriptor_name_on_convert_attribute_displayName() throws Exception {\n //when\n final String value = converter.convert(ApplicationItem.ATTRIBUTE_DISPLAY_NAME);\n\n //then\n assertThat(value).isEqualTo(ApplicationSearchDescri... | {
"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_901 | {
"fields": [
{
"declarator": "factory",
"modifier": "private",
"original_string": "private ConverterFactory factory;",
"type": "ConverterFactory",
"var_name": "factory"
}
],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConverterFacto... | {
"body": "@Test\n public void factoryCreateAnIntegerConverterForIntegerClassName() throws Exception {\n \n Converter<?> createConverter = factory.createConverter(Integer.class.getName());\n \n assertTrue(createConverter instanceof IntegerConverter);\n }",
"class_method_signature":... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConverterFactory.java",
"identifier": "ConverterFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "ConverterFactory.createConverter(String className)",
"constructor": false... | {
"body": "public Converter<?> createConverter(String className) {\n if (isClass(String.class, className)) {\n return new StringConverter();\n } else if (isClass(Date.class, className)) {\n return new DateConverter();\n } else if (isClass(Double.class, className)) {\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_281 | {
"fields": [
{
"declarator": "request",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HttpServletRequest request;",
"type": "HttpServletRequest",
"var_name": "request"
},
{
"declarator": "response",
"modifier": "@Mock\n private",
... | {
"body": "@Test\n public void check_should_not_authorize_requests_to_other_paths() throws Exception {\n String apiPath = \"/API/living/../../WEB-INF/web.xml\";\n\n CustomPageRequestModifier customPageRequestModifier = new CustomPageRequestModifier();\n customPageRequestModifier.forwardIfReque... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(CustomPageRequestModifier.class.getName())",
"modifier": "private static",
"original_string": "private static Logger LOGGER = Logger.getLogger(CustomPageRequestModifier.class.getName());",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "public void forwardIfRequestIsAuthorized(final HttpServletRequest request, final HttpServletResponse response, final String apiPathShouldStartWith, final String apiPath) throws IOException, ServletException {\n try {\n URI uri = new URI(apiPath);\n if (!uri.normalize().toString... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_794 | {
"fields": [],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedActivityTest.java",
"identifier": "APIArchivedActivityTest",
"interfaces": "",
"superclass": "extends APITestWithMock"
} | {
"body": "@Test\n public void should_have_default_search_order() throws Exception {\n final APIArchivedActivity apiActivity = new APIArchivedActivity();\n\n final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder();\n\n assertThat(defineDefaultSearchOrder).as(\"sould have... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedActivity.java",
"identifier": "APIArchivedActivity",
"interfaces": "",
"methods": [
{
"class_method_signature": "APIArchivedActivity.defineItemDefinition()",
"constructor": false,
... | {
"body": "@Override\n public String defineDefaultSearchOrder() {\n return ArchivedActivityItem.ATTRIBUTE_REACHED_STATE_DATE + ISearchDirection.SORT_ORDER_ASCENDING;\n }",
"class_method_signature": "APIArchivedActivity.defineDefaultSearchOrder()",
"constructor": false,
"full_signature": "@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_219 | {
"fields": [
{
"declarator": "request",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest request;",
"type": "HttpServletRequest",
"var_name": "request"
},
{
"declarator": "fileUploadServlet = new TenantFileUploadServlet()",
"modifier": "@Spy... | {
"body": "@Test\n public void getExtension_should_return_proper_extension_for_linux_like_paths() throws IOException {\n // given\n final String filename = \"/Users/Deskt.op/proc.ess.bar\";\n\n // when\n final String extension = fileUploadServlet.getExtension(filename);\n\n // th... | {
"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_649 | {
"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 create_throw_APIException_if_exception_occur_when_creating_user_in_engine_repository() throws Exception {\n UserCreator userCreator = new UserCreator(\"aName\", \"aPassword\");\n when(identityAPI.createUser(userCreator)).thenThrow(new Crea... | {
"fields": [
{
"declarator": "identityAPI",
"modifier": "private",
"original_string": "private IdentityAPI identityAPI;",
"type": "IdentityAPI",
"var_name": "identityAPI"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/UserEngineClient.java",
... | {
"body": "public User create(UserCreator creator) {\n try {\n return identityAPI.createUser(creator);\n } catch (AlreadyExistsException e) {\n throw new APIForbiddenException(new _(\"Can't create user. User '%userName%' already exists\",\n new Arg(\"userName\", ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_5 | {
"fields": [],
"file": "forms/forms-server/src/test/java/org/bonitasoft/forms/server/accessor/widget/impl/XMLExpressionsUtilTest.java",
"identifier": "XMLExpressionsUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void should_parseExpression_do_not_modify_dependencies() throws Exception {\n\t\t//given\n\t\tXMLExpressionsUtil xmlExpressionsUtil = new XMLExpressionsUtil();\n\t\tString expressionParentNodeName = \"script\";\t\n\t\tString expressionTagName = \"input-parameter\";\n\t\t\n\t\tString fileNam... | {
"fields": [
{
"declarator": "INSTANCE = null",
"modifier": "protected static",
"original_string": "protected static XMLExpressionsUtil INSTANCE = null;",
"type": "XMLExpressionsUtil",
"var_name": "INSTANCE"
},
{
"declarator": "NON_APPLICABLE_PREFIX = \"n/a\"",
"... | {
"body": "public Expression parseExpression(final Node expressionParentNode) throws InvalidFormDefinitionException {\n \treturn parseExpression(NON_APPLICABLE_PREFIX, expressionParentNode);\n }",
"class_method_signature": "XMLExpressionsUtil.parseExpression(final Node expressionParentNode)",
"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_425 | {
"fields": [
{
"declarator": "field = Mockito.mock(Field.class)",
"modifier": "@Mock",
"original_string": "@Mock\n Field field = Mockito.mock(Field.class);",
"type": "Field",
"var_name": "field"
},
{
"declarator": "value = Mockito.mock(Value.class)",
"modifier... | {
"body": "@Test\n public void testFilterValue() throws Exception {\n Mockito.doReturn(\"value\").when(value).cast();\n Filter<String> filter = new Filter<String>(field, value);\n\n Assert.assertEquals(\"value\", filter.getValue());\n }",
"class_method_signature": "FilterTest.testFilterVa... | {
"fields": [
{
"declarator": "field",
"modifier": "private",
"original_string": "private Field field;",
"type": "Field",
"var_name": "field"
},
{
"declarator": "value",
"modifier": "private",
"original_string": "private Value<V> value;",
"type": "Valu... | {
"body": "public V getValue() {\n return value != null ? value.cast() : null;\n }",
"class_method_signature": "Filter.getValue()",
"constructor": false,
"full_signature": "public V getValue()",
"identifier": "getValue",
"invocations": [
"cast"
],
"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_31 | {
"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_not_call_evaluateProcessInitialExpressions_nor_evaluateActivityInitialExpressions() throws Exception {\n // Given\n final long processDefinitionID = -1;\n final long activityInstanceID = -1;\n // When\n formWorkflowAPIImpl.getEvaluateCondi... | {
"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_560 | {
"fields": [
{
"declarator": "datastore",
"modifier": "private",
"original_string": "private CaseVariableDatastore datastore;",
"type": "CaseVariableDatastore",
"var_name": "datastore"
},
{
"declarator": "processAPI",
"modifier": "@Mock\n private",
"orig... | {
"body": "@Test\n public void testUpdateVariableValue() throws Exception {\n long caseId = 1L;\n String name = \"aName\";\n String newValue = \"newValue\";\n \n datastore.updateVariableValue(caseId, name, String.class.getName(), newValue);\n\n verify(processAPI).updatePro... | {
"fields": [
{
"declarator": "converter = new TypeConverter()",
"modifier": "private final",
"original_string": "private final TypeConverter converter = new TypeConverter();",
"type": "TypeConverter",
"var_name": "converter"
}
],
"file": "server/src/main/java/org/bonitasoft/... | {
"body": "public void updateVariableValue(final long caseId, final String variableName, final String className, final String newValue) {\n try {\n final Serializable converteValue = converter.convert(className, newValue);\n getEngineProcessAPI().updateProcessDataInstance(variableName, ca... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_130 | {
"fields": [
{
"declarator": "chain",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private FilterChain chain;",
"type": "FilterChain",
"var_name": "chain"
},
{
"declarator": "request",
"modifier": "@Mock\n private",
"original_string":... | {
"body": "@Test\n public void testRedirectTo() throws Exception {\n final String context = \"/bonita\";\n when(httpRequest.getContextPath()).thenReturn(context);\n final long tenantId = 0L;\n authenticationFilter.redirectTo(request, httpResponse, tenantId, AuthenticationFilter.MAINTENA... | {
"fields": [
{
"declarator": "AUTHENTICATION_FILTER_EXCLUDED_PAGES_PATTERN = \"^/(bonita/)?(portal/themeResource$)|(theme/)|(portal/scripts)|(portal/formsService)|(apps/.+/API/)|(portal/resource/.+/API/)\"",
"modifier": "protected static final",
"original_string": "protected static final String... | {
"body": "protected void redirectTo(final HttpServletRequestAccessor request, final HttpServletResponse response, final long tenantId, final String pagePath)\n throws ServletException {\n try {\n response.sendRedirect(request.asHttpServletRequest().getContextPath() + pagePath);\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_833 | {
"fields": [
{
"declarator": "caller",
"modifier": "@Mock(answer = Answers.RETURNS_MOCKS)\n private",
"original_string": "@Mock(answer = Answers.RETURNS_MOCKS)\n private APIServletCall caller;",
"type": "APIServletCall",
"var_name": "caller"
},
{
"declarator": "h... | {
"body": "@Test\n public void should_retrieve_custom_user_info_filtered() throws Exception {\n given(engine.searchCustomUserInfoValues(any(SearchOptions.class))).willReturn(\n new SearchResultImpl<CustomUserInfoValue>(0, Collections.<CustomUserInfoValue> emptyList()));\n ArgumentCapto... | {
"fields": [
{
"declarator": "engineClientCreator",
"modifier": "private",
"original_string": "private CustomUserInfoEngineClientCreator engineClientCreator;",
"type": "CustomUserInfoEngineClientCreator",
"var_name": "engineClientCreator"
},
{
"declarator": "converter ... | {
"body": "@Override\n public ItemSearchResult<CustomUserInfoItem> search(int page, int resultsByPage, String search, String orders, Map<String, String> filters) {\n SearchResult<CustomUserInfoValue> result = getClient().searchCustomUserInfoValues(new SearchOptionsCreator(\n page,\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_66 | {
"fields": [
{
"declarator": "webBonitaConstantsUtils",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private WebBonitaConstantsUtils webBonitaConstantsUtils;",
"type": "WebBonitaConstantsUtils",
"var_name": "webBonitaConstantsUtils"
},
{
"declarator... | {
"body": "@Test\n public void should_unauthorized_a_file_not_in_a_specific_folder() throws Exception {\n\n final File folder = new File(\".\" + File.separator + \"anyFolder\");\n\n final File file = new File(\".\" + File.separator + \"anyFolder\" + File.separator + \"..\" + File.separator + \"..\" +... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(BonitaHomeFolderAccessor.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(BonitaHomeFolderAccessor.class.getName());",
"type": "Logger",
"var_name"... | {
"body": "public boolean isInFolder(final File file, final File parentFolder) throws IOException {\n try {\n verifyFolderAuthorization(file, parentFolder);\n } catch (final UnauthorizedFolderException e) {\n return false;\n }\n return true;\n }",
"class_method_s... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_188 | {
"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 should_send_error_415_when_login_with_wrong_content_type() throws Exception {\n final LoginServlet servlet = spy(new LoginServlet());\n doReturn(\"application/json\").when(req).getContentType();\n\n servlet.doPost(req, resp);\n\n verify(resp).setStatus(Htt... | {
"fields": [
{
"declarator": "serialVersionUID = -5326931127638029215L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = -5326931127638029215L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "LOG... | {
"body": "@Override\n protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {\n\n // force post request body to UTF-8\n try {\n request.setCharacterEncoding(StandardCharsets.UTF_8.name());\n } catch (final UnsupportedEnc... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_472 | {
"fields": [
{
"declarator": "DISPLAY_NAME = \"menu name\"",
"modifier": "private static final",
"original_string": "private static final String DISPLAY_NAME = \"menu name\";",
"type": "String",
"var_name": "DISPLAY_NAME"
},
{
"declarator": "APPLICATION_ID = 1L",
... | {
"body": "@Test\n public void toApplicationMenuUpdater_should_map_all_fields() {\n\n //given\n final HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(ApplicationMenuItem.ATTRIBUTE_APPLICATION_ID, String.valueOf(APPLICATION_ID));\n fields.put(ApplicationMenuI... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationmenu/ApplicationMenuItemConverter.java",
"identifier": "ApplicationMenuItemConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ApplicationMenuItemConverter.toApplicationMenuItem(fina... | {
"body": "public ApplicationMenuUpdater toApplicationMenuUpdater(final Map<String, String> attributes) {\n final ApplicationMenuUpdater applicationMenuUpdater = new ApplicationMenuUpdater();\n\n if (attributes.containsKey(ApplicationMenuItem.ATTRIBUTE_APPLICATION_PAGE_ID)) {\n Long appPageId... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_864 | {
"fields": [],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/json/JSonSimpleDeserializerTest.java",
"identifier": "JSonSimpleDeserializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testObjectWithArray() {\n final AbstractTreeNode<String> tree = JSonSimpleDeserializer.unserializeTree(\"{\\\"name\\\":\\\"toto\\\",\\\"categories_id\\\":[1,2,5]}\");\n\n if (!(tree instanceof TreeIndexed<?>)) {\n fail(\"Fail to parse a compound object in JSO... | {
"fields": [
{
"declarator": "INSTANCE = null",
"modifier": "private static",
"original_string": "private static JSonSimpleDeserializer INSTANCE = null;",
"type": "JSonSimpleDeserializer",
"var_name": "INSTANCE"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/serv... | {
"body": "public static AbstractTreeNode<String> unserializeTree(final String json) {\n\n return getInstance()._unserializeTree(json);\n }",
"class_method_signature": "JSonSimpleDeserializer.unserializeTree(final String json)",
"constructor": false,
"full_signature": "public static AbstractTreeNode<S... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_167 | {
"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 testIfWeRetrieveRequestedTenantId() throws Exception {\n doReturn(\"5\").when(requestAccessor).getTenantId();\n\n TenantIdAccessor accessor = new TenantIdAccessor(requestAccessor);\n\n assertEquals(5L, accessor.getRequestedTenantId());\n }",
"class_method_si... | {
"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_537 | {
"fields": [
{
"declarator": "documentDatastore",
"modifier": "private",
"original_string": "private ArchivedCaseDocumentDatastore documentDatastore;",
"type": "ArchivedCaseDocumentDatastore",
"var_name": "documentDatastore"
},
{
"declarator": "constantsValue",
"... | {
"body": "@Test\n public void it_should_call_engine_processAPI_getDocument() throws Exception {\n // Given\n final APIID id = APIID.makeAPIID(1l);\n\n // When\n documentDatastore.get(id);\n\n // Then\n verify(processAPI).getArchivedProcessDocument(id.toLong());\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 ArchivedCaseDocumentItem get(final APIID id) {\n try {\n final ArchivedDocument documentItem = processAPI.getArchivedProcessDocument(id.toLong());\n return convertEngineToConsoleItem(documentItem);\n } catch (final Exception e) {\n throw ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_89 | {
"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 custom_properties_should_overwrite_internal_properties() throws Exception {\n // given:\n final Properties defaultProps = new Properties();\n defaultProps.put(\"defaultKey\", \"defaultValue\");\n\n final Properties internalProps = new Properties();\n ... | {
"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_258 | {
"fields": [
{
"declarator": "PAGE_ID = 42L",
"modifier": "public static final",
"original_string": "public static final long PAGE_ID = 42L;",
"type": "long",
"var_name": "PAGE_ID"
},
{
"declarator": "pageRenderer",
"modifier": "@Mock",
"original_string": "... | {
"body": "@Test\n public void should_get_Forbidden_Status_when_unauthorized() throws Exception {\n when(hsRequest.getPathInfo()).thenReturn(\"/process/processName/processVersion/content/\");\n doThrow(UnauthorizedAccessException.class).when(pageMappingService).getPage(hsRequest, apiSession, \"proces... | {
"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_608 | {
"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_get_retrieve_role_with_icon() throws Exception {\n //given\n RoleImpl myRole = new RoleImpl(12L, \"myRole\");\n myRole.setIconId(2134L);\n doReturn(myRole).when(identityAPI).getRole(12L);\n //when\n RoleItem roleItem = roleDatastore.ge... | {
"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_464 | {
"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_applicationPageId_on_convert_attribute_applicationPageId() throws Exception {\n //when\n final String convertedValue = converter.convert(ApplicationMenuItem.ATTRIBUTE_APPLICATION_PAGE_ID);\n\n //then\n assertTh... | {
"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_70 | {
"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 testLocalCanBeRetrieveFromCookie() throws Exception {\n Cookie[] cookies = {\n new Cookie(\"aCookie\", \"value\"),\n new Cookie(LocaleUtils.LOCALE_COOKIE_NAME, \"fr\"),\n new Cookie(\"aNullCookie\", null),\n };\n doRet... | {
"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_521 | {
"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_the_applicationPage_supplied_by_the_engine_converted_to_item_on_get() throws Exception {\n //given\n final ApplicationPage applicationPage = mock(ApplicationPage.class);\n final ApplicationPageItem item = mock(ApplicationPageItem.class);\n gi... | {
"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 get(final APIID id) {\n try {\n final ApplicationPage applicationPage = applicationAPI.getApplicationPage(id.toLong());\n return converter.toApplicationPageItem(applicationPage);\n } catch (final Exception e) {\n throw... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_171 | {
"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 should_retrieve_tenant_id_from_cookies_when_not_set_in_request_parameters() throws Exception {\n request.setCookies(new Cookie(\"bonita.tenant\", \"123\"));\n\n long tenantId = tenantIdAccessor.getTenantIdFromRequestOrCookie();\n\n assertThat(tenantId).isEqualTo(... | {
"fields": [
{
"declarator": "request",
"modifier": "private",
"original_string": "private HttpServletRequestAccessor request;",
"type": "HttpServletRequestAccessor",
"var_name": "request"
},
{
"declarator": "portalCookies = new PortalCookies()",
"modifier": "pri... | {
"body": "public long getTenantIdFromRequestOrCookie() throws ServletException {\n String tenantId = request.getTenantId();\n if (tenantId == null) {\n tenantId = portalCookies.getTenantCookieFromRequest(request.asHttpServletRequest());\n }\n if (tenantId == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_872 | {
"fields": [],
"file": "server/src/test/java/org/bonitasoft/web/rest/server/framework/json/JacksonSerializerTest.java",
"identifier": "JacksonSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerialize() throws Exception {\n // Given\n JacksonSerializer serializer = new JacksonSerializer();\n ProfileImportStatusMessageFake message = new ProfileImportStatusMessageFake(\"profile1\", \"repalce\");\n message.addError(\"Organization: skks\");\n ... | {
"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 String serialize(Object obj) throws JsonGenerationException, JsonMappingException, IOException {\n try{\n return mapper.writeValueAsString(obj);\n }catch(Throwable e){\n e.printStackTrace();\n throw new RuntimeException(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_599 | {
"fields": [
{
"declarator": "TENANT_ID = 123532L",
"modifier": "private static final",
"original_string": "private static final long TENANT_ID = 123532L;",
"type": "long",
"var_name": "TENANT_ID"
},
{
"declarator": "processAPI",
"modifier": "@Mock\n private",... | {
"body": "@Test\n public void should_updateUser_call_engine_api() throws Exception {\n //given\n doReturn(new UserImpl(12L, \"john\", \"bpm\")).when(identityAPI).updateUser(eq(12L), any(UserUpdater.class));\n //when\n Map<String, String> attributes = new HashMap<>();\n attribute... | {
"fields": [
{
"declarator": "engineClientFactory",
"modifier": "protected",
"original_string": "protected EngineClientFactory engineClientFactory;",
"type": "EngineClientFactory",
"var_name": "engineClientFactory"
},
{
"declarator": "userItemConverter",
"modifie... | {
"body": "public UserItem update(final APIID id, final Map<String, String> attributes) {\n UserUpdater userUpdater = new UserUpdaterConverter().convert(attributes, getEngineSession().getTenantId(), getBonitaHomeFolderAccessor());\n User user = getUserEngineClient().update(id.toLong(), userUpdater);\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_27 | {
"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 testStoreWidgetsInCacheAndSetCacheIDWithValidators() {\n final List<FormWidget> formWidgets = new ArrayList<FormWidget>();\n final FormWidget widget1 = new FormWidget();\n widget1.setId(\"widget1\");\n widget1.setInitialValueExpression(new Expression(\"nam... | {
"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_433 | {
"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_updated_by_ApplicationAPI_converted_to_ApplicationItem_on_update() throws Exception {\n //given\n final HashMap<String, String> attributesToUpDate = new HashMap<String, String>();\n attributesToUpDate.put(ApplicationItem.ATTRIBUTE_TOKEN,... | {
"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 update(final APIID id, final Map<String, String> attributes) {\n try {\n final ApplicationUpdater applicationUpdater = converter.toApplicationUpdater(attributes);\n final Application application = applicationAPI.updateApplication(id.toLong(... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_825 | {
"fields": [
{
"declarator": "datastore",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ProcessConnectorDependencyDatastore datastore;",
"type": "ProcessConnectorDependencyDatastore",
"var_name": "datastore"
},
{
"declarator": "apiProcessConn... | {
"body": "@Test\n public void checkMandatoryAttributesDontThrowExceptionIfAllAtributesAreSet() throws Exception {\n Map<String, String> filters = buildFilters(\"1\", \"aConnectorName\", \"aConnectorVersion\");\n\n apiProcessConnectorDependency.checkMandatoryAttributes(filters);\n\n assertTrue... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/APIProcessConnectorDependency.java",
"identifier": "APIProcessConnectorDependency",
"interfaces": "implements\n APIHasSearch<ProcessConnectorDependencyItem>",
"methods": [
{
"class_method_signature": ... | {
"body": "protected void checkMandatoryAttributes(final Map<String, String> filters) {\n if (MapUtil.isBlank(filters, ATTRIBUTE_PROCESS_ID)) {\n throw new APIFilterMandatoryException(ATTRIBUTE_PROCESS_ID);\n }\n if (MapUtil.isBlank(filters, ATTRIBUTE_CONNECTOR_NAME)) {\n th... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_126 | {
"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 getProcessDefinitionUUID_should_return_valid_UUID() throws Exception {\n final ProcessDeploymentInfo processDeploymentInfo = mock(ProcessDeploymentInfo.class);\n when(processDeploymentInfo.getName()).thenReturn(\"processName\");\n when(processDeploymentInfo.getVe... | {
"fields": [
{
"declarator": "PROCESS_DEPLOY = \"process_deploy\"",
"modifier": "protected static final",
"original_string": "protected static final String PROCESS_DEPLOY = \"process_deploy\";",
"type": "String",
"var_name": "PROCESS_DEPLOY"
},
{
"declarator": "LOGGER ... | {
"body": "public String getProcessPath(final APISession apiSession, final long processDefinitionId) throws BonitaException, UnsupportedEncodingException {\n final ProcessDeploymentInfo processDeploymentInfo = getProcessAPI(apiSession).getProcessDeploymentInfo(processDefinitionId);\n return encodePathSe... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_576 | {
"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 searchReturnAnEmptyResultIfNoConnectorImplementationIsFound() throws Exception {\n when(this.processAPI.getConnectorImplementation(anyLong(), anyString(), anyString())).thenReturn(null);\n final Map<String, String> filters = buildFilters(1L, \"aConnectorName\", \"1\");\... | {
"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_761 | {
"fields": [
{
"declarator": "apiDocument",
"modifier": "@Spy\n private",
"original_string": "@Spy\n private APICaseDocument apiDocument;",
"type": "APICaseDocument",
"var_name": "apiDocument"
},
{
"declarator": "datastore",
"modifier": "@Mock\n private"... | {
"body": "@Test\n public void it_should_call_the_datastore_update_method() {\n // Given\n final APIID id = APIID.makeAPIID(1l);\n final Map<String, String> attributes = null;\n\n // When\n apiDocument.update(id, attributes);\n\n // Then\n verify(datastore).update(i... | {
"fields": [],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/cases/APICaseDocument.java",
"identifier": "APICaseDocument",
"interfaces": "",
"methods": [
{
"class_method_signature": "APICaseDocument.defineItemDefinition()",
"constructor": false,
"full_signature": ... | {
"body": "@Override\n public CaseDocumentItem update(final APIID id, final Map<String, String> attributes) {\n return getCaseDocumentDatastore().update(id, attributes);\n }",
"class_method_signature": "APICaseDocument.update(final APIID id, final Map<String, String> attributes)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_331 | {
"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(expected = ServletException.class)\n public void should_do_get_without_session_return_servlet_exception() throws Exception {\n\n given(hsRequest.getSession()).willReturn(httpSession);\n given(httpSession.getAttribute(\"apiSession\")).willReturn(null);\n\n spiedApplicationsExpo... | {
"fields": [
{
"declarator": "serialVersionUID = 1800666571090128789L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1800666571090128789L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "server/src/main/j... | {
"body": "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n\n OutputStream out = null;\n try {\n final byte[] resourceBytes = exportResources(request);\n\n // Set response headers\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_624 | {
"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_add() throws IOException {\n // Given\n pageToBeAdded.setAttribute(PageDatastore.UNMAPPED_ATTRIBUTE_ZIP_FILE, \"error_page.zip\");\n doThrow(new IOException(\"error\")).when(tenantFolder).getTempFile(\"error_page.z... | {
"fields": [
{
"declarator": "UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\"",
"modifier": "public static final",
"original_string": "public static final String UNMAPPED_ATTRIBUTE_ZIP_FILE = \"pageZip\";",
"type": "String",
"var_name": "UNMAPPED_ATTRIBUTE_ZIP_FILE"
},
{
"de... | {
"body": "@Override\n public PageItem add(final PageItem pageItem) {\n final String zipFileAttribute = pageItem.getAttributeValue(UNMAPPED_ATTRIBUTE_ZIP_FILE);\n final String[] filenames = zipFileAttribute.split(FileUploadServlet.RESPONSE_SEPARATOR);\n final String filename = filenames[0];\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_274 | {
"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_return_CurrentProfile() throws Exception {\n //given\n doReturn(MY_PROFILE).when(request).getParameter(PageContextHelper.PROFILE_PARAM);\n pageContextHelper = new PageContextHelper(request);\n\n //when\n final String currentProfile = pageCont... | {
"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 String getCurrentProfile() {\n return request.getParameter(PROFILE_PARAM);\n }",
"class_method_signature": "PageContextHelper.getCurrentProfile()",
"constructor": false,
"full_signature": "public String getCurrentProfile()",
"identifier": "getCurrentProfile",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_448 | {
"fields": [
{
"declarator": "STATE = ApplicationState.DEACTIVATED.name()",
"modifier": "private static final",
"original_string": "private static final String STATE = ApplicationState.DEACTIVATED.name();",
"type": "String",
"var_name": "STATE"
},
{
"declarator": "UPDA... | {
"body": "@Test\n public void update_with_no_layout_page_should_send_null() {\n\n //given\n final HashMap<String, String> fields = new HashMap<String, String>();\n fields.put(ApplicationItem.ATTRIBUTE_LAYOUT_ID, \"-1\");\n\n //when\n final ApplicationUpdater updater = converter.... | {
"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_366 | {
"fields": [
{
"declarator": "hsRequest",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest hsRequest;",
"type": "HttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse",
"modifier": "@Mock",
"original_string": "@Mo... | {
"body": "@Test\n public void should_send_error_404_when_the_custom_page_is_not_associated_to_application() throws Exception {\n doThrow(new ApplicationPageNotFoundException(\"error\")).when(router).route(eq(hsRequest), eq(hsResponse), eq(session), eq(pageRenderer), eq(resourceRenderer), any(BonitaHomeFold... | {
"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_736 | {
"fields": [
{
"declarator": "generator = new SHA1Generator()",
"modifier": "private",
"original_string": "private SHA1Generator generator = new SHA1Generator();",
"type": "SHA1Generator",
"var_name": "generator"
},
{
"declarator": "session",
"modifier": "@Mock\n... | {
"body": "@Test\n public void should_build_rights_for_a_token_add_to_it() throws Exception {\n given(session.getId()).willReturn(56L);\n UserRightsBuilder builder = new UserRightsBuilder(session, new TokenListProvider(Arrays.asList(\n \"token\")));\n\n assertEquals(builder.buil... | {
"fields": [
{
"declarator": "session",
"modifier": "private",
"original_string": "private org.bonitasoft.engine.session.APISession session;",
"type": "org.bonitasoft.engine.session.APISession",
"var_name": "session"
},
{
"declarator": "provider",
"modifier": "pr... | {
"body": "public List<String> build() {\n List<String> rights = new ArrayList<String>();\n for (String token : provider.getTokens()) {\n rights.add(generator.getHash(token.concat(String.valueOf(session.getId()))));\n }\n return rights;\n }",
"class_method_signature": "User... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_223 | {
"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_an_empty_filename_for_parent_folder_filename() throws IOException {\n // given\n final String filename = \"../../../\";\n\n // when\n final String filenameLastSegment = fileUploadServlet.getFilenameLastSegment(filename)... | {
"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_389 | {
"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_CaseInfoResource_for_CaseInfoResourceFinder() {\n final CaseInfoResourceFinder caseInfoResourceFinder = spy(new CaseInfoResourceFinder());\n doReturn(processAPI).when(caseInfoResourceFinder).getProcessAPI(any(Request.class));\n final ServerResource ... | {
"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_673 | {
"fields": [
{
"declarator": "groupAPI",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private GroupAPI groupAPI;",
"type": "GroupAPI",
"var_name": "groupAPI"
},
{
"declarator": "groupEngineClient",
"modifier": "private",
"original_string... | {
"body": "@Test(expected = APIException.class)\n public void update_throw_APIException_if_an_exception_occurs_when_updating_in_engine_repository() throws Exception {\n when(groupAPI.updateGroup(eq(1L), any(GroupUpdater.class))).thenThrow(new UpdateException(\"\"));\n \n groupEngineClient.upda... | {
"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_809 | {
"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\n public void should_return() throws DataNotFoundException {\n // given\n doReturn(\"\").when(activityVariableResource).getAttribute(ActivityVariableResource.ACTIVITYDATA_DATA_NAME);\n doReturn(\"1\").when(activityVariableResource).getAttribute(ActivityVariableResource.ACTIVIT... | {
"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_720 | {
"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_empty_response() throws Exception {\n //given\n method = new Method(GET);\n doReturn(method).when(request).getMethod();\n doReturn(new RestApiResponseBuilder().build()).when(restApiRenderer).handleRestApiCall(any(HttpServletRequest.cla... | {
"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_370 | {
"fields": [
{
"declarator": "hsRequest",
"modifier": "@Mock",
"original_string": "@Mock\n HttpServletRequest hsRequest;",
"type": "HttpServletRequest",
"var_name": "hsRequest"
},
{
"declarator": "hsResponse",
"modifier": "@Mock",
"original_string": "@Mo... | {
"body": "@Test\n public void should_send_error_404_when_the_page_is_not_found() throws Exception {\n doThrow(new ApplicationPageNotFoundException(\"error\")).when(router).route(eq(hsRequest), eq(hsResponse), eq(session), eq(pageRenderer), eq(resourceRenderer), any(BonitaHomeFolderAccessor.class));\n\n ... | {
"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_665 | {
"fields": [
{
"declarator": "engine",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private IdentityAPI engine;",
"type": "IdentityAPI",
"var_name": "engine"
},
{
"declarator": "client",
"modifier": "@InjectMocks\n private",
"original... | {
"body": "@Test\n public void should_list_custom_information_for_a_given_user() {\n given(engine.getCustomUserInfo(1L, 0, 2)).willReturn(Arrays.asList(\n new CustomUserInfo(1L, new EngineCustomUserInfoDefinition(1L), new CustomUserInfoValueImpl()),\n new CustomUserInfo(1L, new... | {
"fields": [
{
"declarator": "identity",
"modifier": "private",
"original_string": "private IdentityAPI identity;",
"type": "IdentityAPI",
"var_name": "identity"
}
],
"file": "server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CustomUserInfoEngineClient.java",
... | {
"body": "public List<CustomUserInfo> listCustomInformation(long userId, int startIndex, int maxResult) {\n return identity.getCustomUserInfo(userId, startIndex, maxResult);\n }",
"class_method_signature": "CustomUserInfoEngineClient.listCustomInformation(long userId, int startIndex, int maxResult)",
"... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_235 | {
"fields": [
{
"declarator": "DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L",
"modifier": "public static final",
"original_string": "public static final long DATE_01_01_1970_13H_AS_LONG_GMT = 46800000L;",
"type": "long",
"var_name": "DATE_01_01_1970_13H_AS_LONG_GMT"
},
{
... | {
"body": "@Test\n public void getProcessedInputs_with_simple_input_should_return_processed_input_with_null() throws Exception {\n final List<InputDefinition> inputDefinition = generateSimpleInputDefinition(true);\n when(contractDefinition.getInputs()).thenReturn(inputDefinition);\n final Map<... | {
"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_409 | {
"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_greater_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<Str... | {
"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_327 | {
"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_getFileUploadParamName_return_expected_name() throws Exception {\n assertEquals(spiedApplicationImportService.getFileUploadParamName(), \"applicationsDataUpload\");\n }",
"class_method_signature": "ApplicationsImportServiceTest.should_getFileUploadParamName_return_... | {
"fields": [
{
"declarator": "TOKEN = \"/application/import\"",
"modifier": "public final static",
"original_string": "public final static String TOKEN = \"/application/import\";",
"type": "String",
"var_name": "TOKEN"
},
{
"declarator": "FILE_UPLOAD = \"applicationsDa... | {
"body": "@Override\n public String getFileUploadParamName() {\n return FILE_UPLOAD;\n }",
"class_method_signature": "ApplicationsImportService.getFileUploadParamName()",
"constructor": false,
"full_signature": "@Override public String getFileUploadParamName()",
"identifier": "getFileUploadParam... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_777 | {
"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 defineDefaultSearchOrder_should_be_descending_creation_date() {\n // When\n final String defineDefaultSearchOrder = apiCase.defineDefaultSearchOrder();\n\n // Then\n assertEquals(ProcessInstanceCriterion.CREATION_DATE_DESC.name(), defineDefaultSearch... | {
"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 String defineDefaultSearchOrder() {\n return ProcessInstanceCriterion.CREATION_DATE_DESC.name();\n }",
"class_method_signature": "APICase.defineDefaultSearchOrder()",
"constructor": false,
"full_signature": "@Override public String defineDefaultSearchOrder()",
"ident... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_798 | {
"fields": [
{
"declarator": "processAPI",
"modifier": "@Mock",
"original_string": "@Mock\n ProcessAPI processAPI;",
"type": "ProcessAPI",
"var_name": "processAPI"
},
{
"declarator": "restResource",
"modifier": "private",
"original_string": "private Time... | {
"body": "@Test(expected = APIException.class)\n public void searchTimerEventTriggersShouldThrowExceptionIfParameterNotFound() throws Exception {\n // given:\n doReturn(null).when(restResource).getParameter(anyString(), anyBoolean());\n\n // when:\n restResource.searchTimerEventTrigger... | {
"fields": [
{
"declarator": "ID_PARAM_NAME = \"id\"",
"modifier": "public static final",
"original_string": "public static final String ID_PARAM_NAME = \"id\";",
"type": "String",
"var_name": "ID_PARAM_NAME"
},
{
"declarator": "processAPI",
"modifier": "private ... | {
"body": "@Get(\"json\")\n public void searchTimerEventTriggers() {\n try {\n final Long caseId = getLongParameter(\"caseId\", true);\n final SearchResult<TimerEventTriggerInstance> searchResult = processAPI.searchTimerEventTriggerInstances(caseId, buildSearchOptions());\n ... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_262 | {
"fields": [
{
"declarator": "PAGE_ID = 42L",
"modifier": "public static final",
"original_string": "public static final long PAGE_ID = 42L;",
"type": "long",
"var_name": "PAGE_ID"
},
{
"declarator": "pageRenderer",
"modifier": "@Mock",
"original_string": "... | {
"body": "@Test\n public void should_not_get_not_found_when_empty_mapping() throws Exception {\n when(hsRequest.getPathInfo()).thenReturn(\"/process/processName/processVersion/content/\");\n final PageReference pageReference = new PageReference(null, null);\n doReturn(pageReference).when(page... | {
"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_632 | {
"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 testAPIIdsToLong() {\n final APIID id1 = makeAPIID(\"1\");\n final APIID id2 = makeAPIID(\"2\");\n final List<APIID> listId = Arrays.asList(id1, id2);\n\n assertThat(pageDatastore.APIIdsToLong(listId)).isEqualTo(Arrays.asList(1L, 2L));\n }",
"class_me... | {
"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 List<Long> APIIdsToLong(final List<APIID> ids) {\n final List<Long> result = new ArrayList<>(ids.size());\n for (final APIID id : ids) {\n result.add(id.toLong());\n }\n return result;\n }",
"class_method_signature": "PageDatastore.APIIdsToLong(final Li... | {
"created": null,
"fork": null,
"fork_count": 45,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 11337147,
"size": 98566,
"stargazer_count": 19,
"stars": null,
"updates": null,
"url": "https://github.com/bonitasoft/bonita-web"
} |
11337147_848 | {
"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_add() throws Exception {\n UserItem userItem = new UserItem();\n userItem.setUserName(\"John\");\n userItem.setPassword(\"this password is not accepted by the TestValidator validator\");\n\n expectedException.expect(Vali... | {
"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"
} |
13160719_0 | {
"fields": [],
"file": "metrics-new-relic-extras/src/test/java/com/palominolabs/metrics/newrelic/table/YamlMetricsAttributeTableLoaderTest.java",
"identifier": "YamlMetricsAttributeTableLoaderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getReturnTableReadFromFile() throws Exception {\n YamlMetricsAttributeTableLoader loader = new YamlMetricsAttributeTableLoader();\n InputStream stream = getClass().getResourceAsStream(\"testing-config.yml\");\n Table<String, TableMetricAttributeFilter.NewRelicMet... | {
"fields": [
{
"declarator": "objectReader",
"modifier": "@Nonnull\n private final",
"original_string": "@Nonnull\n private final ObjectReader objectReader;",
"type": "ObjectReader",
"var_name": "objectReader"
}
],
"file": "metrics-new-relic-extras/src/main/java/com/pa... | {
"body": "public Table<String, NewRelicMetric, Boolean> loadTable(@Nonnull InputStream inputStream) throws IOException {\n Map<String, Map<NewRelicMetric, Boolean>> m =\n objectReader.forType(new TypeReference<Map<String, Map<NewRelicMetric, Boolean>>>() {})\n .readValue(... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 13160719,
"size": 441,
"stargazer_count": 38,
"stars": null,
"updates": null,
"url": "https://github.com/palominolabs/metrics-new-relic"
} |
13160719_1 | {
"fields": [
{
"declarator": "timer = new Timer()",
"modifier": "private final",
"original_string": "private final Timer timer = new Timer();",
"type": "Timer",
"var_name": "timer"
}
],
"file": "metrics-new-relic-extras/src/test/java/com/palominolabs/metrics/newrelic/table/T... | {
"body": "@Test\n public void metricSetToFalseInConfigFile() throws Exception {\n TableMetricAttributeFilter instance =\n new TableMetricAttributeFilter(getTable(\"testing-config.yml\"),\n new AllEnabledMetricAttributeFilter());\n\n assertThat(instance.recordTim... | {
"fields": [
{
"declarator": "enabledMetrics",
"modifier": "private final",
"original_string": "private final Table<String, NewRelicMetric, Boolean> enabledMetrics;",
"type": "Table<String, NewRelicMetric, Boolean>",
"var_name": "enabledMetrics"
},
{
"declarator": "fal... | {
"body": "@Override\n public boolean recordTimerMin(final String name, final Timer metric) {\n return isEnabledWithFallback(name, NewRelicMetric.TIMER_MIN, new Supplier<Boolean>() {\n @Override\n public Boolean get() {\n return fallback.recordTimerMin(name, metric);\n ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 13160719,
"size": 441,
"stargazer_count": 38,
"stars": null,
"updates": null,
"url": "https://github.com/palominolabs/metrics-new-relic"
} |
2394379_30 | {
"fields": [],
"file": "core/src/test/java/de/bwaldvogel/mongo/backend/AssertTest.java",
"identifier": "AssertTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testNotEmpty() throws Exception {\n Assert.notEmpty(Arrays.asList(\"a\", \"b\", \"c\"));\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> Assert.notEmpty(Collections.emptySet()))\n .withMessage(\"Given collection must not ... | {
"fields": [],
"file": "core/src/main/java/de/bwaldvogel/mongo/backend/Assert.java",
"identifier": "Assert",
"interfaces": "",
"methods": [
{
"class_method_signature": "Assert.isEmpty(Collection<?> values)",
"constructor": false,
"full_signature": "public static void isEmpty(Collection<... | {
"body": "public static void notEmpty(Collection<?> values) {\n notEmpty(values, () -> \"Given collection must not be empty\");\n }",
"class_method_signature": "Assert.notEmpty(Collection<?> values)",
"constructor": false,
"full_signature": "public static void notEmpty(Collection<?> values)",
"iden... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_127 | {
"fields": [],
"file": "core/src/test/java/de/bwaldvogel/mongo/backend/StreamUtilsTest.java",
"identifier": "StreamUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testToLinkedHashSet() throws Exception {\n Set<String> result = Stream.of(\"a\", \"b\", \"c\", \"b\")\n .collect(StreamUtils.toLinkedHashSet());\n assertThat(result).containsExactly(\"a\", \"b\", \"c\");\n }",
"class_method_signature": "StreamUtilsTest.testToLi... | {
"fields": [],
"file": "core/src/main/java/de/bwaldvogel/mongo/backend/StreamUtils.java",
"identifier": "StreamUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StreamUtils.StreamUtils()",
"constructor": true,
"full_signature": "private StreamUtils()",
"identifi... | {
"body": "static <T> Collector<T, ?, Set<T>> toLinkedHashSet() {\n return Collectors.toCollection(LinkedHashSet::new);\n }",
"class_method_signature": "StreamUtils.toLinkedHashSet()",
"constructor": false,
"full_signature": "static Collector<T, ?, Set<T>> toLinkedHashSet()",
"identifier": "toLinked... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_88 | {
"fields": [
{
"declarator": "matcher = new DefaultQueryMatcher()",
"modifier": "private final",
"original_string": "private final QueryMatcher matcher = new DefaultQueryMatcher();",
"type": "QueryMatcher",
"var_name": "matcher"
}
],
"file": "core/src/test/java/de/bwaldvogel... | {
"body": "@Test\n void testMatchesAllElements() throws Exception {\n Document document = json(\"list: [{a: 'b'}, {c: 'd'}]\");\n\n assertThat(matcher.matches(document, json(\"list: {$all: [{$elemMatch: {a: 'b'}}]}\"))).isTrue();\n assertThat(matcher.matches(document, json(\"list: {$all: [{$el... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DefaultQueryMatcher.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DefaultQueryMatcher.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n public boolean matches(Document document, Document query) {\n for (String key : query.keySet()) {\n Object queryValue = query.get(key);\n validateQueryValue(queryValue, key);\n if (!checkMatch(queryValue, key, document)) {\n return false... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_67 | {
"fields": [
{
"declarator": "matcher = new DefaultQueryMatcher()",
"modifier": "private final",
"original_string": "private final QueryMatcher matcher = new DefaultQueryMatcher();",
"type": "QueryMatcher",
"var_name": "matcher"
}
],
"file": "core/src/test/java/de/bwaldvogel... | {
"body": "@Test\n void testMatchNotEqualArray() throws Exception {\n assertThat(matcher.matches(json(\"a: []\"), json(\"a: {$ne: []}\"))).isFalse();\n assertThat(matcher.matches(json(\"a: null\"), json(\"a: {$ne: []}\"))).isTrue();\n assertThat(matcher.matches(json(\"\"), json(\"a: {$ne: []}\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DefaultQueryMatcher.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DefaultQueryMatcher.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n public boolean matches(Document document, Document query) {\n for (String key : query.keySet()) {\n Object queryValue = query.get(key);\n validateQueryValue(queryValue, key);\n if (!checkMatch(queryValue, key, document)) {\n return false... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_1 | {
"fields": [],
"file": "postgresql-backend/src/test/java/de/bwaldvogel/mongo/backend/postgresql/PostgresqlUtilsTest.java",
"identifier": "PostgresqlUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testToDataKey() throws Exception {\n assertThat(PostgresqlUtils.toDataKey(\"foo\")).isEqualTo(\"data ->> 'foo'\");\n assertThat(PostgresqlUtils.toDataKey(\"foo.bar\")).isEqualTo(\"data -> 'foo' ->> 'bar'\");\n assertThat(PostgresqlUtils.toDataKey(\"foo.bar.bla\")).isEqu... | {
"fields": [
{
"declarator": "SQL_ERROR_DUPLICATE_KEY = \"23505\"",
"modifier": "private static final",
"original_string": "private static final String SQL_ERROR_DUPLICATE_KEY = \"23505\";",
"type": "String",
"var_name": "SQL_ERROR_DUPLICATE_KEY"
}
],
"file": "postgresql-bac... | {
"body": "public static String toDataKey(String key) {\n if (!key.matches(\"^[a-zA-Z0-9_.]+$\")) {\n throw new IllegalArgumentException(\"Illegal key: \" + key);\n }\n List<String> keys = Arrays.asList(key.split(\"\\\\.\"));\n StringBuilder sb = new StringBuilder(\"data\");\n ... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_170 | {
"fields": [],
"file": "core/src/test/java/de/bwaldvogel/mongo/backend/UtilsTest.java",
"identifier": "UtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testChangeSubdocumentValue() throws Exception {\n Document document = json(\"_id: 1, foo: {bar: 1, bla: 2}\");\n\n Utils.changeSubdocumentValue(document, \"foo.bar\", 3);\n assertThat(document).isEqualTo(json(\"_id: 1, foo: {bar: 3, bla: 2}\"));\n\n Utils.changeS... | {
"fields": [
{
"declarator": "PATH_DELIMITER = \".\"",
"modifier": "public static final",
"original_string": "public static final String PATH_DELIMITER = \".\";",
"type": "String",
"var_name": "PATH_DELIMITER"
},
{
"declarator": "PATH_DELIMITER_PATTERN = Pattern.compil... | {
"body": "static void changeSubdocumentValue(Object document, String key, Object newValue, Integer matchPos) {\n changeSubdocumentValue(document, key, newValue, new AtomicReference<>(matchPos));\n }",
"class_method_signature": "Utils.changeSubdocumentValue(Object document, String key, Object newValue, In... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_71 | {
"fields": [
{
"declarator": "matcher = new DefaultQueryMatcher()",
"modifier": "private final",
"original_string": "private final QueryMatcher matcher = new DefaultQueryMatcher();",
"type": "QueryMatcher",
"var_name": "matcher"
}
],
"file": "core/src/test/java/de/bwaldvogel... | {
"body": "@Test\n void testMatchesNotIn() throws Exception {\n Document query1 = map(\"map.key2\", notIn(\"value 2.2\"));\n Document query2 = map(\"map.key2\", not(in(\"value 2.2\")));\n Document query3 = map(\"map.key2\", not(notIn(\"value 2.2\")));\n Document query4 = map(\"map.key2\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DefaultQueryMatcher.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DefaultQueryMatcher.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n public boolean matches(Document document, Document query) {\n for (String key : query.keySet()) {\n Object queryValue = query.get(key);\n validateQueryValue(queryValue, key);\n if (!checkMatch(queryValue, key, document)) {\n return false... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
2394379_189 | {
"fields": [],
"file": "core/src/test/java/de/bwaldvogel/mongo/wire/MongoDatabaseHandlerTest.java",
"identifier": "MongoDatabaseHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testNonWrappedCommand() throws Exception {\n final MongoBackend backend = mock(MongoBackend.class);\n final Channel channel = mock(Channel.class);\n\n final Document queryDoc = json(\"'count': 'collectionName'\");\n final MongoQuery query = new MongoQuery(channel... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(MongoWireProtocolHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(MongoWireProtocolHandler.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "CompletionStage<Document> handleCommandAsync(MongoQuery query) {\n String collectionName = query.getCollectionName();\n\n if (\"$cmd.sys.inprog\".equals(collectionName)) {\n return FutureUtils.wrap(() -> mongoBackend.getCurrentOperations(query))\n .thenApply(currentO... | {
"created": "9/15/2011 6:22:58 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 2394379,
"size": null,
"stargazer_count": null,
"stars": 167,
"updates": "2020-01-20T10:23:28+00:00",
"url": "https://github.com/bwaldvogel/mongo-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.