id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
96123627_111 | {
"fields": [
{
"declarator": "chemistryMap = null",
"modifier": "private static",
"original_string": "private static Map<String, Object> chemistryMap = null;",
"type": "Map<String, Object>",
"var_name": "chemistryMap"
},
{
"declarator": "physicsMap = null",
"modi... | {
"body": "@Test\n public void testUpsertDataSuccess() {\n Map<String, Object> data = new HashMap<String, Object>();\n data.put(\"test\", \"test\");\n Future<Boolean> response = esService.upsert(INDEX_NAME, \"test-12349\", data);\n boolean result = (boolean) ElasticSearchHelper.getResponseFromFuture(resp... | {
"fields": [
{
"declarator": "WAIT_TIME = 30",
"modifier": "public static final",
"original_string": "public static final int WAIT_TIME = 30;",
"type": "int",
"var_name": "WAIT_TIME"
},
{
"declarator": "timeout = new Timeout(WAIT_TIME, TimeUnit.SECONDS)",
"modifi... | {
"body": "@Override\n public Future<Boolean> upsert(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<Boolean> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:upsert: method started at ==\" + startTime + \... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_64 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/utils/scanner/classpath/ClassPathResourceTest.java",
"identifier": "ClassPathResourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void loadAsStringUtf8WithBOM() {\n assertEquals(\n \"SELECT * FROM contents;\",\n new ClassPathResource(\n \"com/contrastsecurity/cassandra/migration/utils/scanner/classpath/utf8bom.nofilter\",\n Thread.currentThread().getContextClassLoader())\... | {
"fields": [
{
"declarator": "location",
"modifier": "private",
"original_string": "private String location;",
"type": "String",
"var_name": "location"
},
{
"declarator": "classLoader",
"modifier": "private",
"original_string": "private ClassLoader classLoa... | {
"body": "public String loadAsString(String encoding) {\n try {\n InputStream inputStream = classLoader.getResourceAsStream(location);\n if (inputStream == null) {\n throw new CassandraMigrationException(\n \"Unable to obtain inputstream for resource: \" + location);\n }\n Re... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_280 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testStatusSuccess() {\n assertEquals(1, ProjectUtil.Status.ACTIVE.getValue());\n assertEquals(0, ProjectUtil.Status.INACTIVE.getValue());\n assertEquals(false, ProjectUtil.ActiveStatus.INACTIVE.getValue());\n assertEquals(true, ProjectUtil.ActiveStatus.ACTIVE.getValue());\n... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "private static Object getValue(Map<String, Object> map, String key) {\n Object value = map.get(key);\n map.remove(key);\n return value;\n }",
"class_method_signature": "ProjectUtil.getValue(Map<String, Object> map, String key)",
"constructor": false,
"full_signature": "private static Object... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_296 | {
"fields": [
{
"declarator": "JSON_STRING_DATA = \"asdasasfasfsdfdsfdsfgsd\"",
"modifier": "public static final",
"original_string": "public static final String JSON_STRING_DATA = \"asdasasfasfsdfdsfdsfgsd\";",
"type": "String",
"var_name": "JSON_STRING_DATA"
}
],
"file": "s... | {
"body": "@Test\n public void testPostFormDataSuccess() {\n Map<String, String> reqData = new HashMap<>();\n reqData.put(\"field1\", \"value1\");\n reqData.put(\"field2\", \"value2\");\n\n Map<String, byte[]> fileData = new HashMap<>();\n fileData.put(\"file1\", (\"asd\".getBytes()));\n\n Map<Stri... | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/HttpUtil.java",
"identifier": "HttpUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "HttpUtil.HttpUtil()",
"constructor": true,
"full_signature": "private HttpUtil()"... | {
"body": "public static HttpUtilResponse postFormData(\n Map<String, String> reqData,\n Map<String, byte[]> fileData,\n Map<String, String> headers,\n String url)\n throws IOException {\n long startTime = System.currentTimeMillis();\n Map<String, Object> logInfo = genarateLogInfo(JsonK... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_72 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testSaveFailure() {\n mockRulesForSave(true);\n Future<String> result = esService.save(\"test\", \"001\", new HashMap<>());\n String res = (String) ElasticSearchHelper.getResponseFromFuture(result);\n assertEquals(null, res);\n }",
"class_method_signature": "ElasticSearc... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<String> save(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<String> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchUtilRest:save: method started at ==\" + startTime + \" for... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_279 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testSourceSuccess() {\n assertEquals(\"web\", ProjectUtil.Source.WEB.getValue());\n assertEquals(\"android\", ProjectUtil.Source.ANDROID.getValue());\n assertEquals(\"ios\", ProjectUtil.Source.IOS.getValue());\n }",
"class_method_signature": "ProjectUtilTest.testSourceSucce... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "private static Object getValue(Map<String, Object> map, String key) {\n Object value = map.get(key);\n map.remove(key);\n return value;\n }",
"class_method_signature": "ProjectUtil.getValue(Map<String, Object> map, String key)",
"constructor": false,
"full_signature": "private static Object... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_25 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/cql/CqlMigrationResolverTest.java",
"identifier": "CqlMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = CassandraMigrationException.class)\n public void resolveMigrationsNonExisting() {\n CqlMigrationResolver cqlMigrationResolver =\n new CqlMigrationResolver(\n Thread.currentThread().getContextClassLoader(),\n new ScriptsLocation(\"non/existing\"),\n ... | {
"fields": [
{
"declarator": "scanner",
"modifier": "private final",
"original_string": "private final Scanner scanner;",
"type": "Scanner",
"var_name": "scanner"
},
{
"declarator": "location",
"modifier": "private final",
"original_string": "private final ... | {
"body": "public List<ResolvedMigration> resolveMigrations() {\n List<ResolvedMigration> migrations = new ArrayList<>();\n\n Resource[] resources =\n scanner.scanForResources(location, CQL_MIGRATION_PREFIX, CQL_MIGRATION_SUFFIX);\n for (Resource resource : resources) {\n ResolvedMigration resolv... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_107 | {
"fields": [
{
"declarator": "chemistryMap = null",
"modifier": "private static",
"original_string": "private static Map<String, Object> chemistryMap = null;",
"type": "Map<String, Object>",
"var_name": "chemistryMap"
},
{
"declarator": "physicsMap = null",
"modi... | {
"body": "@Test\n public void testGetDataByIdentifierFailureByEmptyIdentifier() {\n Future<Map<String, Object>> responseMap = esService.getDataByIdentifier(INDEX_NAME, \"\");\n Map<String, Object> response =\n (Map<String, Object>) ElasticSearchHelper.getResponseFromFuture(responseMap);\n assertEqua... | {
"fields": [
{
"declarator": "WAIT_TIME = 30",
"modifier": "public static final",
"original_string": "public static final int WAIT_TIME = 30;",
"type": "int",
"var_name": "WAIT_TIME"
},
{
"declarator": "timeout = new Timeout(WAIT_TIME, TimeUnit.SECONDS)",
"modifi... | {
"body": "@Override\n public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) {\n long startTime = System.currentTimeMillis();\n Promise<Map<String, Object>> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:getDataByIdentifier: method started... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_170 | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/test/java/org/sunbird/common/request/RequestValidatorTest.java",
"identifier": "RequestValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidateEnrolmentTypeSuccessWithOpenType() {\n boolean response = false;\n try {\n RequestValidator.validateEnrolmentType(ProjectUtil.EnrolmentType.open.getVal());\n response = true;\n } catch (ProjectCommonException e) {\n Assert.assertNull(e);\n }\n ... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public static void validateEnrolmentType(String enrolmentType) {\n if (StringUtils.isBlank(enrolmentType)) {\n throw new ProjectCommonException(\n ResponseCode.enrolmentTypeRequired.getErrorCode(),\n ResponseCode.enrolmentTypeRequired.getErrorMessage(),\n ERROR_CODE);\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_259 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testValidatePhoneNumberSuccess() {\n assertTrue(ProjectUtil.validatePhoneNumber(\"9844016699\"));\n }",
"class_method_signature": "ProjectUtilTest.testValidatePhoneNumberSuccess()",
"constructor": false,
"full_signature": "@Test public void testValidatePhoneNumberSuccess()",
... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static boolean validatePhoneNumber(String phone) {\n String phoneNo = \"\";\n phoneNo = phone.replace(\"+\", \"\");\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n else if (phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n else if (phoneNo.ma... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_52 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/utils/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isNumeric() {\n assertFalse(StringUtils.isNumeric(null));\n assertTrue(StringUtils.isNumeric(\"\"));\n assertFalse(StringUtils.isNumeric(\" \"));\n assertTrue(StringUtils.isNumeric(\"123\"));\n assertFalse(StringUtils.isNumeric(\"12 3\"));\n assertFalse(StringUtils.i... | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/main/java/com/contrastsecurity/cassandra/migration/utils/StringUtils.java",
"identifier": "StringUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringUtils.StringUtils()",
"constructor": true,
... | {
"body": "public static boolean isNumeric(String str) {\n return str != null && str.matches(\"\\\\d*\");\n }",
"class_method_signature": "StringUtils.isNumeric(String str)",
"constructor": false,
"full_signature": "public static boolean isNumeric(String str)",
"identifier": "isNumeric",
"invocations": ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_127 | {
"fields": [
{
"declarator": "keyCloakService = SSOServiceFactory.getInstance()",
"modifier": "private",
"original_string": "private SSOManager keyCloakService = SSOServiceFactory.getInstance();",
"type": "SSOManager",
"var_name": "keyCloakService"
},
{
"declarator": "... | {
"body": "@Test(expected = ProjectCommonException.class)\n public void testRemoveUserSuccess() {\n\n Map<String, Object> request = new HashMap<String, Object>();\n request.put(JsonKey.USER_ID, \"123\");\n keyCloakService.removeUser(request);\n }",
"class_method_signature": "KeyCloakServiceImplTest.testR... | {
"fields": [
{
"declarator": "keycloak = KeyCloakConnectionProvider.getConnection()",
"modifier": "private",
"original_string": "private Keycloak keycloak = KeyCloakConnectionProvider.getConnection();",
"type": "Keycloak",
"var_name": "keycloak"
},
{
"declarator": "URL... | {
"body": "@Override\n public String removeUser(Map<String, Object> request) {\n Keycloak keycloak = KeyCloakConnectionProvider.getConnection();\n String userId = (String) request.get(JsonKey.USER_ID);\n try {\n String fedUserId = getFederatedUserId(userId);\n UserResource resource =\n ke... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_131 | {
"fields": [
{
"declarator": "keyCloakService = SSOServiceFactory.getInstance()",
"modifier": "private",
"original_string": "private SSOManager keyCloakService = SSOServiceFactory.getInstance();",
"type": "SSOManager",
"var_name": "keyCloakService"
},
{
"declarator": "... | {
"body": "@Test\n public void testActivateUserFailureWithEmptyUserId() {\n Map<String, Object> reqMap = new HashMap<>();\n reqMap.put(JsonKey.USER_ID, \"\");\n try {\n keyCloakService.activateUser(reqMap);\n } catch (ProjectCommonException e) {\n Assert.assertEquals(ResponseCode.invalidUsrData... | {
"fields": [
{
"declarator": "keycloak = KeyCloakConnectionProvider.getConnection()",
"modifier": "private",
"original_string": "private Keycloak keycloak = KeyCloakConnectionProvider.getConnection();",
"type": "Keycloak",
"var_name": "keycloak"
},
{
"declarator": "URL... | {
"body": "@Override\n public String activateUser(Map<String, Object> request) {\n String userId = (String) request.get(JsonKey.USER_ID);\n makeUserActiveOrInactive(userId, true);\n return JsonKey.SUCCESS;\n }",
"class_method_signature": "KeyCloakServiceImpl.activateUser(Map<String, Object> request)",
... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_218 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateAssignRoleSuccess() {\n Request request = new Request();\n boolean response = false;\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.USER_ID, \"ORG-provider\");\n requestObj.put(JsonKey.EXTERNAL_ID, \"EXT_ID\");\n requestObj.pu... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateAssignRole(Request request) {\n if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.USER_ID))) {\n ProjectCommonException.throwClientErrorException(ResponseCode.userIdRequired);\n }\n\n if (request.getRequest().get(JsonKey.ROLES) == null\n || !(request... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_13 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/CompositeMigrationResolverTest.java",
"identifier": "CompositeMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void checkForIncompatibilitiesMessage() {\n ResolvedMigration migration1 =\n createTestMigration(MigrationType.CQL, \"1\", \"First\", \"V1__First.cql\", 123);\n migration1.setPhysicalLocation(\"target/test-classes/migration/validate/V1__First.cql\");\n\n ResolvedMigration mi... | {
"fields": [
{
"declarator": "migrationResolvers = new ArrayList<MigrationResolver>()",
"modifier": "private",
"original_string": "private Collection<MigrationResolver> migrationResolvers = new ArrayList<MigrationResolver>();",
"type": "Collection<MigrationResolver>",
"var_name": "m... | {
"body": "static void checkForIncompatibilities(List<ResolvedMigration> migrations) {\n // check for more than one migration with same version\n for (int i = 0; i < migrations.size() - 1; i++) {\n ResolvedMigration current = migrations.get(i);\n ResolvedMigration next = migrations.get(i + 1);\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_189 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidatePasswordFailure() {\n Request request = initailizeRequest();\n Map<String, Object> requestObj = request.getRequest();\n requestObj.put(JsonKey.PASSWORD, \"password\");\n request.setRequest(requestObj);\n try {\n userRequestValidator.validateCreateUserReq... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateCreateUserRequest(Request userRequest) {\n externalIdsValidation(userRequest, JsonKey.CREATE);\n fieldsNotAllowed(\n Arrays.asList(\n JsonKey.REGISTERED_ORG_ID,\n JsonKey.ROOT_ORG_ID,\n JsonKey.PROVIDER,\n JsonKey.EXTERNAL_ID,\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_166 | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/test/java/org/sunbird/common/request/RequestValidatorTest.java",
"identifier": "RequestValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidateSendMailFailureWithEmptyBody() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.SUBJECT, \"test123\");\n requestObj.put(JsonKey.BODY, \"\");\n request.setRequest(requestObj);\n try {\n R... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public static void validateSendMail(Request request) {\n if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.SUBJECT))) {\n throw new ProjectCommonException(\n ResponseCode.emailSubjectError.getErrorCode(),\n ResponseCode.emailSubjectError.getErrorMessage(),\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_44 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/config/KeyspaceTest.java",
"identifier": "KeyspaceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldHaveDefaultClusterObject() {\n assertThat(new Keyspace().getCluster(), is(notNullValue()));\n }",
"class_method_signature": "KeyspaceTest.shouldHaveDefaultClusterObject()",
"constructor": false,
"full_signature": "@Test public void shouldHaveDefaultClusterObject()",
"... | {
"fields": [
{
"declarator": "PROPERTY_PREFIX = \"cassandra.migration.keyspace.\"",
"modifier": "private static final",
"original_string": "private static final String PROPERTY_PREFIX = \"cassandra.migration.keyspace.\";",
"type": "String",
"var_name": "PROPERTY_PREFIX"
},
{... | {
"body": "public Cluster getCluster() {\n return cluster;\n }",
"class_method_signature": "Keyspace.getCluster()",
"constructor": false,
"full_signature": "public Cluster getCluster()",
"identifier": "getCluster",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Cluster",
... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_234 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateCreateUserFailureWithEmptyEducationName() {\n Request request = initailizeRequest();\n request.getRequest().put(JsonKey.PHONE_VERIFIED, true);\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.NAME, \"\");\n List<Map<String, Object>> list = new A... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateCreateUserRequest(Request userRequest) {\n externalIdsValidation(userRequest, JsonKey.CREATE);\n fieldsNotAllowed(\n Arrays.asList(\n JsonKey.REGISTERED_ORG_ID,\n JsonKey.ROOT_ORG_ID,\n JsonKey.PROVIDER,\n JsonKey.EXTERNAL_ID,\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_68 | {
"fields": [],
"file": "sunbird-es-utils/src/test/java/org/sunbird/common/factory/EsClientFactoryTest.java",
"identifier": "EsClientFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testInstanceNull() {\n\t\tElasticSearchService service = EsClientFactory.getInstance(\"test\");\n\t\tAssert.assertNull(service);\n\t}",
"class_method_signature": "EsClientFactoryTest.testInstanceNull()",
"constructor": false,
"full_signature": "@Test public void testInstanceNull(... | {
"fields": [
{
"declarator": "tcpClient = null",
"modifier": "private static",
"original_string": "private static ElasticSearchService tcpClient = null;",
"type": "ElasticSearchService",
"var_name": "tcpClient"
},
{
"declarator": "restClient = null",
"modifier": ... | {
"body": "public static ElasticSearchService getInstance(String type) {\n if (JsonKey.TCP.equals(type)) {\n return getTcpClient();\n } else if (JsonKey.REST.equals(type)) {\n return getRestClient();\n } else {\n ProjectLogger.log(\n \"EsClientFactory:getInstance: value for client typ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_326 | {
"fields": [
{
"declarator": "iterator",
"modifier": "private static",
"original_string": "private static Iterator iterator;",
"type": "Iterator",
"var_name": "iterator"
},
{
"declarator": "row",
"modifier": "private static",
"original_string": "private sta... | {
"body": "@Test\n public void testDeleteRecordSuccess() throws Exception {\n\n when(QueryBuilder.delete()).thenReturn(deleteSelection);\n Response response = new Response();\n response.put(JsonKey.RESPONSE, Constants.SUCCESS);\n operation.deleteRecord(cassandraKeySpace, \"address\", \"123\");\n asser... | {
"fields": [
{
"declarator": "connectionManager",
"modifier": "protected",
"original_string": "protected CassandraConnectionManager connectionManager;",
"type": "CassandraConnectionManager",
"var_name": "connectionManager"
}
],
"file": "sunbird-cassandra-utils/src/main/java/... | {
"body": "@Override\n public Response deleteRecord(String keyspaceName, String tableName, String identifier) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"Cassandra Service deleteRecord method started at ==\" + startTime, LoggerEnum.INFO);\n Response response = new Respon... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_263 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testFormatMessageSuccess() {\n String msg = ProjectUtil.formatMessage(\"Hello {0}\", \"user\");\n assertEquals(\"Hello user\", msg);\n }",
"class_method_signature": "ProjectUtilTest.testFormatMessageSuccess()",
"constructor": false,
"full_signature": "@Test public void tes... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static String formatMessage(String exceptionMsg, Object... fieldValue) {\n return MessageFormat.format(exceptionMsg, fieldValue);\n }",
"class_method_signature": "ProjectUtil.formatMessage(String exceptionMsg, Object... fieldValue)",
"constructor": false,
"full_signature": "public static S... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_87 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testUpsertFailureWithEmptyIndex() {\n try {\n esService.update(\"\", \"001\", new HashMap<>());\n } catch (ProjectCommonException e) {\n assertEquals(e.getResponseCode(), ResponseCode.invalidData.getResponseCode());\n }\n }",
"class_method_signature": "ElasticSear... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<Boolean> update(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"ElasticSearchRestHighImpl:update: method started at ==\"\n + startTime\n + \" for Index \"\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_91 | {
"fields": [
{
"declarator": "chemistryMap = null",
"modifier": "private static",
"original_string": "private static Map<String, Object> chemistryMap = null;",
"type": "Map<String, Object>",
"var_name": "chemistryMap"
},
{
"declarator": "physicsMap = null",
"modi... | {
"body": "@Test\n public void testCreateDataSuccess() {\n mockRulesForInsert();\n\n esService.save(INDEX_NAME, (String) chemistryMap.get(\"courseId\"), chemistryMap);\n assertNotNull(chemistryMap.get(\"courseId\"));\n\n esService.save(INDEX_NAME, (String) physicsMap.get(\"courseId\"), physicsMap);\n ... | {
"fields": [
{
"declarator": "WAIT_TIME = 30",
"modifier": "public static final",
"original_string": "public static final int WAIT_TIME = 30;",
"type": "int",
"var_name": "WAIT_TIME"
},
{
"declarator": "timeout = new Timeout(WAIT_TIME, TimeUnit.SECONDS)",
"modifi... | {
"body": "@Override\n public Future<String> save(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<String> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:save: method started at ==\" + startTime + \" for ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_275 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testCourseMgmtStatusSuccess() {\n assertEquals(\"draft\", ProjectUtil.CourseMgmtStatus.DRAFT.getValue());\n assertEquals(\"live\", ProjectUtil.CourseMgmtStatus.LIVE.getValue());\n assertEquals(\"retired\", ProjectUtil.CourseMgmtStatus.RETIRED.getValue());\n }",
"class_metho... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "private static Object getValue(Map<String, Object> map, String key) {\n Object value = map.get(key);\n map.remove(key);\n return value;\n }",
"class_method_signature": "ProjectUtil.getValue(Map<String, Object> map, String key)",
"constructor": false,
"full_signature": "private static Object... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_29 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/info/MigrationVersionTest.java",
"identifier": "MigrationVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void compareTo() {\n MigrationVersion v1 = MigrationVersion.fromVersion(\"1\");\n MigrationVersion v10 = MigrationVersion.fromVersion(\"1.0\");\n MigrationVersion v11 = MigrationVersion.fromVersion(\"1.1\");\n MigrationVersion v1100 = MigrationVersion.fromVersion(\"1.1.0.0\");\n... | {
"fields": [
{
"declarator": "EMPTY = new MigrationVersion(null, \"<< Empty Schema >>\")",
"modifier": "public static final",
"original_string": "public static final MigrationVersion EMPTY = new MigrationVersion(null, \"<< Empty Schema >>\");",
"type": "MigrationVersion",
"var_name"... | {
"body": "@Override\n public int compareTo(MigrationVersion o) {\n if (o == null) {\n return 1;\n }\n\n if (this == EMPTY) {\n return o == EMPTY ? 0 : Integer.MIN_VALUE;\n }\n\n if (this == CURRENT) {\n return o == CURRENT ? 0 : Integer.MIN_VALUE;\n }\n\n if (this == LATEST) {\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_222 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testCreateUserBasicValidationFailureWithoutEmailAndPhone() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.USERNAME, \"test123\");\n requestObj.put(JsonKey.FIRST_NAME, \"test123\");\n requestObj.put(JsonKe... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void createUserBasicValidation(Request userRequest) {\n\n createUserBasicProfileFieldsValidation(userRequest);\n if (userRequest.getRequest().containsKey(JsonKey.ROLES)\n && null != userRequest.getRequest().get(JsonKey.ROLES)\n && !(userRequest.getRequest().get(JsonKey.ROLES) ins... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_28 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/cql/CqlMigrationResolverTest.java",
"identifier": "CqlMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void extractScriptNameFileSystemPrefix() {\n CqlMigrationResolver cqlMigrationResolver =\n new CqlMigrationResolver(\n Thread.currentThread().getContextClassLoader(),\n new ScriptsLocation(\"filesystem:/some/dir\"),\n \"UTF-8\");\n\n assertEqual... | {
"fields": [
{
"declarator": "scanner",
"modifier": "private final",
"original_string": "private final Scanner scanner;",
"type": "Scanner",
"var_name": "scanner"
},
{
"declarator": "location",
"modifier": "private final",
"original_string": "private final ... | {
"body": "String extractScriptName(Resource resource) {\n if (location.getPath().isEmpty()) {\n return resource.getLocation();\n }\n\n return resource.getLocation().substring(location.getPath().length() + 1);\n }",
"class_method_signature": "CqlMigrationResolver.extractScriptName(Resource resource)"... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_223 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testCreateUserBasicValidationFailureWithInvalidEmail() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.USERNAME, \"test123\");\n requestObj.put(JsonKey.FIRST_NAME, \"test123\");\n requestObj.put(JsonKey.DO... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void createUserBasicValidation(Request userRequest) {\n\n createUserBasicProfileFieldsValidation(userRequest);\n if (userRequest.getRequest().containsKey(JsonKey.ROLES)\n && null != userRequest.getRequest().get(JsonKey.ROLES)\n && !(userRequest.getRequest().get(JsonKey.ROLES) ins... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_90 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testBuilInsertFailure() {\n mockRulesForBulk(true);\n List<Map<String, Object>> list = new ArrayList<>();\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.IDENTIFIER, \"0001\");\n list.add(map);\n Future<Boolean> result = esService.bulkInsert(\"test\", l... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"ElasticSearchRestHighImpl:bulkInsert: method started at ==\"\n + startTime\n + \" for Index \"\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_274 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testOrgStatusSuccess() {\n assertEquals(new Integer(0), ProjectUtil.OrgStatus.INACTIVE.getValue());\n assertEquals(new Integer(1), ProjectUtil.OrgStatus.ACTIVE.getValue());\n assertEquals(new Integer(2), ProjectUtil.OrgStatus.BLOCKED.getValue());\n assertEquals(new Integer(... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "private static Object getValue(Map<String, Object> map, String key) {\n Object value = map.get(key);\n map.remove(key);\n return value;\n }",
"class_method_signature": "ProjectUtil.getValue(Map<String, Object> map, String key)",
"constructor": false,
"full_signature": "private static Object... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_69 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testSaveSuccess() {\n mockRulesForSave(false);\n Future<String> result = esService.save(\"test\", \"001\", new HashMap<>());\n String res = (String) ElasticSearchHelper.getResponseFromFuture(result);\n assertEquals(\"001\", res);\n }",
"class_method_signature": "ElasticS... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<String> save(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<String> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchUtilRest:save: method started at ==\" + startTime + \" for... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_327 | {
"fields": [
{
"declarator": "iterator",
"modifier": "private static",
"original_string": "private static Iterator iterator;",
"type": "Iterator",
"var_name": "iterator"
},
{
"declarator": "row",
"modifier": "private static",
"original_string": "private sta... | {
"body": "@Test\n public void testDeleteRecordFailure() {\n\n when(QueryBuilder.delete())\n .thenThrow(\n new ProjectCommonException(\n ResponseCode.SERVER_ERROR.getErrorCode(),\n ResponseCode.SERVER_ERROR.getErrorMessage(),\n ResponseCode.SERVER_ERR... | {
"fields": [
{
"declarator": "connectionManager",
"modifier": "protected",
"original_string": "protected CassandraConnectionManager connectionManager;",
"type": "CassandraConnectionManager",
"var_name": "connectionManager"
}
],
"file": "sunbird-cassandra-utils/src/main/java/... | {
"body": "@Override\n public Response deleteRecord(String keyspaceName, String tableName, String identifier) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"Cassandra Service deleteRecord method started at ==\" + startTime, LoggerEnum.INFO);\n Response response = new Respon... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_262 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testCreateCheckResponseFailureWithException() {\n Map<String, Object> responseMap =\n ProjectUtil.createCheckResponse(\n \"LearnerService\",\n true,\n new ProjectCommonException(\n ResponseCode.invalidObjectType.getErrorCode(),\... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static Map<String, Object> createCheckResponse(\n String serviceName, boolean isError, Exception e) {\n Map<String, Object> responseMap = new HashMap<>();\n responseMap.put(JsonKey.NAME, serviceName);\n if (!isError) {\n responseMap.put(JsonKey.Healthy, true);\n responseMap.p... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_86 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testUpsertFailure() {\n mockRulesForUpdate(true);\n Future<Boolean> result = esService.update(\"test\", \"001\", new HashMap<>());\n Object res = ElasticSearchHelper.getResponseFromFuture(result);\n assertEquals(null, res);\n }",
"class_method_signature": "ElasticSearchR... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<Boolean> update(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"ElasticSearchRestHighImpl:update: method started at ==\"\n + startTime\n + \" for Index \"\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_235 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateCreateUserFailureWithEmptyEducationDegree() {\n Request request = initailizeRequest();\n request.getRequest().put(JsonKey.PHONE_VERIFIED, true);\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.NAME, \"name\");\n map.put(JsonKey.DEGREE, \"\");\n... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateCreateUserRequest(Request userRequest) {\n externalIdsValidation(userRequest, JsonKey.CREATE);\n fieldsNotAllowed(\n Arrays.asList(\n JsonKey.REGISTERED_ORG_ID,\n JsonKey.ROOT_ORG_ID,\n JsonKey.PROVIDER,\n JsonKey.EXTERNAL_ID,\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_45 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/config/ScriptsLocationsTest.java",
"identifier": "ScriptsLocationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void mergeLocations() {\n ScriptsLocations locations = new ScriptsLocations(\"db/locations\", \"db/files\", \"db/classes\");\n List<ScriptsLocation> locationList = locations.getLocations();\n assertEquals(3, locationList.size());\n Iterator<ScriptsLocation> iterator = locationLi... | {
"fields": [
{
"declarator": "LOG = LogFactory.getLog(ScriptsLocations.class)",
"modifier": "private static final",
"original_string": "private static final Log LOG = LogFactory.getLog(ScriptsLocations.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "loca... | {
"body": "public List<ScriptsLocation> getLocations() {\n return locations;\n }",
"class_method_signature": "ScriptsLocations.getLocations()",
"constructor": false,
"full_signature": "public List<ScriptsLocation> getLocations()",
"identifier": "getLocations",
"invocations": [],
"modifiers": "public",... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_167 | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/test/java/org/sunbird/common/request/RequestValidatorTest.java",
"identifier": "RequestValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidateSendMailFailureWithEmptySubject() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.SUBJECT, \"\");\n request.setRequest(requestObj);\n try {\n RequestValidator.validateSendMail(request);\n ... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public static void validateSendMail(Request request) {\n if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.SUBJECT))) {\n throw new ProjectCommonException(\n ResponseCode.emailSubjectError.getErrorCode(),\n ResponseCode.emailSubjectError.getErrorMessage(),\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_219 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateAssignRoleSuccessWithProviderAndExternalId() {\n Request request = new Request();\n boolean response = false;\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.PROVIDER, \"ORG-provider\");\n requestObj.put(JsonKey.EXTERNAL_ID, \"ORG... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateAssignRole(Request request) {\n if (StringUtils.isBlank((String) request.getRequest().get(JsonKey.USER_ID))) {\n ProjectCommonException.throwClientErrorException(ResponseCode.userIdRequired);\n }\n\n if (request.getRequest().get(JsonKey.ROLES) == null\n || !(request... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_12 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/CompositeMigrationResolverTest.java",
"identifier": "CompositeMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void collectMigrations() {\n MigrationResolver migrationResolver =\n new MigrationResolver() {\n public List<ResolvedMigration> resolveMigrations() {\n List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>();\n\n migrations.add(\n ... | {
"fields": [
{
"declarator": "migrationResolvers = new ArrayList<MigrationResolver>()",
"modifier": "private",
"original_string": "private Collection<MigrationResolver> migrationResolvers = new ArrayList<MigrationResolver>();",
"type": "Collection<MigrationResolver>",
"var_name": "m... | {
"body": "static Collection<ResolvedMigration> collectMigrations(\n Collection<MigrationResolver> migrationResolvers) {\n Set<ResolvedMigration> migrations = new HashSet<ResolvedMigration>();\n for (MigrationResolver migrationResolver : migrationResolvers) {\n migrations.addAll(migrationResolver.reso... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_130 | {
"fields": [
{
"declarator": "keyCloakService = SSOServiceFactory.getInstance()",
"modifier": "private",
"original_string": "private SSOManager keyCloakService = SSOServiceFactory.getInstance();",
"type": "SSOManager",
"var_name": "keyCloakService"
},
{
"declarator": "... | {
"body": "@Test\n public void testGetLastLoginTimeSuccess() {\n String lastLoginTime = keyCloakService.getLastLoginTime(userId.get(JsonKey.USER_ID));\n Assert.assertNull(lastLoginTime);\n }",
"class_method_signature": "KeyCloakServiceImplTest.testGetLastLoginTimeSuccess()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "keycloak = KeyCloakConnectionProvider.getConnection()",
"modifier": "private",
"original_string": "private Keycloak keycloak = KeyCloakConnectionProvider.getConnection();",
"type": "Keycloak",
"var_name": "keycloak"
},
{
"declarator": "URL... | {
"body": "@Override\n public String getLastLoginTime(String userId) {\n String lastLoginTime = null;\n try {\n String fedUserId = getFederatedUserId(userId);\n UserResource resource =\n keycloak.realm(KeyCloakConnectionProvider.SSO_REALM).users().get(fedUserId);\n UserRepresentation ur... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_126 | {
"fields": [
{
"declarator": "keyCloakService = SSOServiceFactory.getInstance()",
"modifier": "private",
"original_string": "private SSOManager keyCloakService = SSOServiceFactory.getInstance();",
"type": "SSOManager",
"var_name": "keyCloakService"
},
{
"declarator": "... | {
"body": "@Test(expected = ProjectCommonException.class)\n public void testDeactivateUserSuccess() {\n\n Map<String, Object> request = new HashMap<String, Object>();\n request.put(JsonKey.USER_ID, \"123\");\n request.put(JsonKey.FIRST_NAME, userName);\n keyCloakService.deactivateUser(request);\n }",
... | {
"fields": [
{
"declarator": "keycloak = KeyCloakConnectionProvider.getConnection()",
"modifier": "private",
"original_string": "private Keycloak keycloak = KeyCloakConnectionProvider.getConnection();",
"type": "Keycloak",
"var_name": "keycloak"
},
{
"declarator": "URL... | {
"body": "@Override\n public String deactivateUser(Map<String, Object> request) {\n String userId = (String) request.get(JsonKey.USER_ID);\n makeUserActiveOrInactive(userId, false);\n return JsonKey.SUCCESS;\n }",
"class_method_signature": "KeyCloakServiceImpl.deactivateUser(Map<String, Object> request)... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_258 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testValidatePhoneNumberFailureWithInvalidPhoneNumber() {\n assertFalse(ProjectUtil.validatePhoneNumber(\"312\"));\n }",
"class_method_signature": "ProjectUtilTest.testValidatePhoneNumberFailureWithInvalidPhoneNumber()",
"constructor": false,
"full_signature": "@Test public vo... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static boolean validatePhoneNumber(String phone) {\n String phoneNo = \"\";\n phoneNo = phone.replace(\"+\", \"\");\n if (phoneNo.matches(\"\\\\d{10}\")) return true;\n else if (phoneNo.matches(\"\\\\d{3}[-\\\\.\\\\s]\\\\d{3}[-\\\\.\\\\s]\\\\d{4}\")) return true;\n else if (phoneNo.ma... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_53 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/utils/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void collapseWhitespace() {\n assertEquals(\"\", StringUtils.collapseWhitespace(\"\"));\n assertEquals(\"abc\", StringUtils.collapseWhitespace(\"abc\"));\n assertEquals(\"a b\", StringUtils.collapseWhitespace(\"a b\"));\n assertEquals(\" a \", StringUtils.collapseWhitespace(\" a... | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/main/java/com/contrastsecurity/cassandra/migration/utils/StringUtils.java",
"identifier": "StringUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringUtils.StringUtils()",
"constructor": true,
... | {
"body": "public static String collapseWhitespace(String str) {\n return str.replaceAll(\"\\\\s+\", \" \");\n }",
"class_method_signature": "StringUtils.collapseWhitespace(String str)",
"constructor": false,
"full_signature": "public static String collapseWhitespace(String str)",
"identifier": "collapseW... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_171 | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/test/java/org/sunbird/common/request/RequestValidatorTest.java",
"identifier": "RequestValidatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidateEnrolmentTypeSuccessWithInviteType() {\n boolean response = false;\n try {\n RequestValidator.validateEnrolmentType(ProjectUtil.EnrolmentType.inviteOnly.getVal());\n response = true;\n } catch (ProjectCommonException e) {\n Assert.assertNull(e);\n ... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public static void validateEnrolmentType(String enrolmentType) {\n if (StringUtils.isBlank(enrolmentType)) {\n throw new ProjectCommonException(\n ResponseCode.enrolmentTypeRequired.getErrorCode(),\n ResponseCode.enrolmentTypeRequired.getErrorMessage(),\n ERROR_CODE);\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_106 | {
"fields": [
{
"declarator": "chemistryMap = null",
"modifier": "private static",
"original_string": "private static Map<String, Object> chemistryMap = null;",
"type": "Map<String, Object>",
"var_name": "chemistryMap"
},
{
"declarator": "physicsMap = null",
"modi... | {
"body": "@Test\n public void testSaveDataFailureWithoutIndexName() {\n Future<String> response =\n esService.save(\"\", (String) chemistryMap.get(\"courseId\"), chemistryMap);\n String result = (String) ElasticSearchHelper.getResponseFromFuture(response);\n assertEquals(\"ERROR\", result);\n }",
... | {
"fields": [
{
"declarator": "WAIT_TIME = 30",
"modifier": "public static final",
"original_string": "public static final int WAIT_TIME = 30;",
"type": "int",
"var_name": "WAIT_TIME"
},
{
"declarator": "timeout = new Timeout(WAIT_TIME, TimeUnit.SECONDS)",
"modifi... | {
"body": "@Override\n public Future<String> save(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<String> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:save: method started at ==\" + startTime + \" for ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_24 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/cql/CqlMigrationResolverTest.java",
"identifier": "CqlMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void resolveMigrations() {\n CqlMigrationResolver cqlMigrationResolver =\n new CqlMigrationResolver(\n Thread.currentThread().getContextClassLoader(),\n new ScriptsLocation(\"migration/subdir\"),\n \"UTF-8\");\n Collection<ResolvedMigration> mig... | {
"fields": [
{
"declarator": "scanner",
"modifier": "private final",
"original_string": "private final Scanner scanner;",
"type": "Scanner",
"var_name": "scanner"
},
{
"declarator": "location",
"modifier": "private final",
"original_string": "private final ... | {
"body": "public List<ResolvedMigration> resolveMigrations() {\n List<ResolvedMigration> migrations = new ArrayList<>();\n\n Resource[] resources =\n scanner.scanForResources(location, CQL_MIGRATION_PREFIX, CQL_MIGRATION_SUFFIX);\n for (Resource resource : resources) {\n ResolvedMigration resolv... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_297 | {
"fields": [
{
"declarator": "JSON_STRING_DATA = \"asdasasfasfsdfdsfdsfgsd\"",
"modifier": "public static final",
"original_string": "public static final String JSON_STRING_DATA = \"asdasasfasfsdfdsfdsfgsd\";",
"type": "String",
"var_name": "JSON_STRING_DATA"
}
],
"file": "s... | {
"body": "@Test\n public void testSendPatchRequestSuccess() {\n\n Map<String, String> headers = new HashMap<>();\n headers.put(\"Authorization\", \"123456\");\n String url = \"http://localhost:8000/v1/issuer/issuers\";\n try {\n CloseableHttpResponse closeableHttpResponseMock =\n PowerMock... | {
"fields": [],
"file": "sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/HttpUtil.java",
"identifier": "HttpUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "HttpUtil.HttpUtil()",
"constructor": true,
"full_signature": "private HttpUtil()"... | {
"body": "public static String sendPatchRequest(\n String requestURL, String params, Map<String, String> headers) throws IOException {\n long startTime = System.currentTimeMillis();\n Map<String, Object> logInfo = genarateLogInfo(JsonKey.API_CALL, \"API CALL : \" + requestURL);\n ProjectLogger.log(\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_73 | {
"fields": [
{
"declarator": "esService = EsClientFactory.getInstance(JsonKey.REST)",
"modifier": "private",
"original_string": "private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);",
"type": "ElasticSearchService",
"var_name": "esService"
},
{... | {
"body": "@Test\n public void testUpdateSuccess() {\n mockRulesForUpdate(false);\n Future<Boolean> result = esService.update(\"test\", \"001\", new HashMap<>());\n boolean res = (boolean) ElasticSearchHelper.getResponseFromFuture(result);\n assertEquals(true, res);\n }",
"class_method_signature": "El... | {
"fields": [
{
"declarator": "ERROR = \"ERROR\"",
"modifier": "private static final",
"original_string": "private static final String ERROR = \"ERROR\";",
"type": "String",
"var_name": "ERROR"
}
],
"file": "sunbird-es-utils/src/main/java/org/sunbird/common/ElasticSearchRestH... | {
"body": "@Override\n public Future<Boolean> update(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"ElasticSearchRestHighImpl:update: method started at ==\"\n + startTime\n + \" for Index \"\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_278 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testObjectTypesSuccess() {\n assertEquals(\"batch\", ProjectUtil.ObjectTypes.batch.getValue());\n assertEquals(\"user\", ProjectUtil.ObjectTypes.user.getValue());\n assertEquals(\"organisation\", ProjectUtil.ObjectTypes.organisation.getValue());\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "private static Object getValue(Map<String, Object> map, String key) {\n Object value = map.get(key);\n map.remove(key);\n return value;\n }",
"class_method_signature": "ProjectUtil.getValue(Map<String, Object> map, String key)",
"constructor": false,
"full_signature": "private static Object... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_65 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/utils/UrlUtilsTest.java",
"identifier": "UrlUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void toFilePath() throws MalformedURLException {\n File file = new File(\"/test dir/a+b\");\n assertEquals(file.getAbsolutePath(), UrlUtils.toFilePath(file.toURI().toURL()));\n }",
"class_method_signature": "UrlUtilsTest.toFilePath()",
"constructor": false,
"full_signature": "@... | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/main/java/com/contrastsecurity/cassandra/migration/utils/UrlUtils.java",
"identifier": "UrlUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "UrlUtils.UrlUtils()",
"constructor": true,
"full_sig... | {
"body": "public static String toFilePath(URL url) {\n try {\n String filePath =\n new File(URLDecoder.decode(url.getPath().replace(\"+\", \"%2b\"), \"UTF-8\")).getAbsolutePath();\n if (filePath.endsWith(\"/\")) {\n return filePath.substring(0, filePath.length() - 1);\n }\n ret... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_281 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testCreateAndThrowServerErrorSuccess() {\n try {\n ProjectUtil.createAndThrowServerError();\n } catch (ProjectCommonException e) {\n assertEquals(ResponseCode.SERVER_ERROR.getResponseCode(), e.getResponseCode());\n assertEquals(ResponseCode.SERVER_ERROR.getErrorCod... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static void createAndThrowServerError() {\n throw new ProjectCommonException(\n ResponseCode.SERVER_ERROR.getErrorCode(),\n ResponseCode.SERVER_ERROR.getErrorMessage(),\n ResponseCode.SERVER_ERROR.getResponseCode());\n }",
"class_method_signature": "ProjectUtil.createAndTh... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_110 | {
"fields": [
{
"declarator": "chemistryMap = null",
"modifier": "private static",
"original_string": "private static Map<String, Object> chemistryMap = null;",
"type": "Map<String, Object>",
"var_name": "chemistryMap"
},
{
"declarator": "physicsMap = null",
"modi... | {
"body": "@Test\n public void testHealthCheckSuccess() {\n Future<Boolean> response = esService.healthCheck();\n boolean result = (boolean) ElasticSearchHelper.getResponseFromFuture(response);\n assertEquals(true, result);\n }",
"class_method_signature": "ElasticSearchTcpImplTest.testHealthCheckSuccess(... | {
"fields": [
{
"declarator": "WAIT_TIME = 30",
"modifier": "public static final",
"original_string": "public static final int WAIT_TIME = 30;",
"type": "int",
"var_name": "WAIT_TIME"
},
{
"declarator": "timeout = new Timeout(WAIT_TIME, TimeUnit.SECONDS)",
"modifi... | {
"body": "@Override\n public Future<Boolean> healthCheck() {\n Promise<Boolean> promise = Futures.promise();\n\n boolean indexResponse = false;\n try {\n indexResponse =\n ConnectionManager.getClient()\n .admin()\n .indices()\n .exists(Requests.indicesEx... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_32 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/info/MigrationVersionTest.java",
"identifier": "MigrationVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void latest() {\n assertEquals(MigrationVersion.LATEST, MigrationVersion.LATEST);\n assertTrue(MigrationVersion.LATEST.compareTo(MigrationVersion.LATEST) == 0);\n }",
"class_method_signature": "MigrationVersionTest.latest()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "EMPTY = new MigrationVersion(null, \"<< Empty Schema >>\")",
"modifier": "public static final",
"original_string": "public static final MigrationVersion EMPTY = new MigrationVersion(null, \"<< Empty Schema >>\");",
"type": "MigrationVersion",
"var_name"... | {
"body": "@Override\n public int compareTo(MigrationVersion o) {\n if (o == null) {\n return 1;\n }\n\n if (this == EMPTY) {\n return o == EMPTY ? 0 : Integer.MIN_VALUE;\n }\n\n if (this == CURRENT) {\n return o == CURRENT ? 0 : Integer.MIN_VALUE;\n }\n\n if (this == LATEST) {\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_239 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateCreateUserFailureWithEmptyJobName() {\n Request request = initailizeRequest();\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.JOB_NAME, \"\");\n map.put(JsonKey.ORG_NAME, \"degree\");\n List<Map<String, Object>> list = new ArrayList<>();\n ... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateCreateUserRequest(Request userRequest) {\n externalIdsValidation(userRequest, JsonKey.CREATE);\n fieldsNotAllowed(\n Arrays.asList(\n JsonKey.REGISTERED_ORG_ID,\n JsonKey.ROOT_ORG_ID,\n JsonKey.PROVIDER,\n JsonKey.EXTERNAL_ID,\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_0 | {
"fields": [
{
"declarator": "authenticator = null",
"modifier": "private static",
"original_string": "private static GMailAuthenticator authenticator = null;",
"type": "GMailAuthenticator",
"var_name": "authenticator"
},
{
"declarator": "emailService = null",
"m... | {
"body": "@Test\n public void passwordAuthTest() {\n PasswordAuthentication authentication = authenticator.getPasswordAuthentication();\n Assert.assertEquals(\"test\", authentication.getPassword());\n }",
"class_method_signature": "EmailTest.passwordAuthTest()",
"constructor": false,
"full_signature": ... | {
"fields": [
{
"declarator": "logger = LogManager.getLogger(Email.class)",
"modifier": "private static",
"original_string": "private static Logger logger = LogManager.getLogger(Email.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "props = null",
... | {
"body": "public String getPassword() {\n return password;\n }",
"class_method_signature": "Email.getPassword()",
"constructor": false,
"full_signature": "public String getPassword()",
"identifier": "getPassword",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_242 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateCreateUserFailureWithEmptyJobProfileOrgName() {\n Request request = initailizeRequest();\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.JOB_NAME, \"kijklo\");\n map.put(JsonKey.ORG_NAME, \"\");\n List<Map<String, Object>> list = new ArrayList<... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateCreateUserRequest(Request userRequest) {\n externalIdsValidation(userRequest, JsonKey.CREATE);\n fieldsNotAllowed(\n Arrays.asList(\n JsonKey.REGISTERED_ORG_ID,\n JsonKey.ROOT_ORG_ID,\n JsonKey.PROVIDER,\n JsonKey.EXTERNAL_ID,\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_49 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/config/ScriptsLocationsTest.java",
"identifier": "ScriptsLocationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void mergeLocationsSimilarButNoOverlapCamelCase() {\n ScriptsLocations locations = new ScriptsLocations(\"/com/xxx/Star/\", \"/com/xxx/StarTrack/\");\n List<ScriptsLocation> locationList = locations.getLocations();\n assertEquals(2, locationList.size());\n assertTrue(locationLis... | {
"fields": [
{
"declarator": "LOG = LogFactory.getLog(ScriptsLocations.class)",
"modifier": "private static final",
"original_string": "private static final Log LOG = LogFactory.getLog(ScriptsLocations.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "loca... | {
"body": "public List<ScriptsLocation> getLocations() {\n return locations;\n }",
"class_method_signature": "ScriptsLocations.getLocations()",
"constructor": false,
"full_signature": "public List<ScriptsLocation> getLocations()",
"identifier": "getLocations",
"invocations": [],
"modifiers": "public",... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_215 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testPhoneValidationFailureWithPhoneVerifiedFalse() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.PHONE, \"9321234123\");\n requestObj.put(JsonKey.COUNTRY_CODE, \"+91\");\n requestObj.put(JsonKey.PROVIDER... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void phoneValidation(Request userRequest) {\n if (!StringUtils.isBlank((String) userRequest.getRequest().get(JsonKey.COUNTRY_CODE))) {\n boolean bool =\n ProjectUtil.validateCountryCode(\n (String) userRequest.getRequest().get(JsonKey.COUNTRY_CODE));\n if (!bool) {... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_203 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateChangePasswordSuccess() {\n Request request = new Request();\n boolean response = false;\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.NEW_PASSWORD, \"password1\");\n requestObj.put(JsonKey.PASSWORD, \"password\");\n request.... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void validateChangePassword(Request userRequest) {\n if (userRequest.getRequest().get(JsonKey.PASSWORD) == null\n || (StringUtils.isBlank((String) userRequest.getRequest().get(JsonKey.PASSWORD)))) {\n ProjectCommonException.throwClientErrorException(ResponseCode.passwordRequired);\n ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_192 | {
"fields": [
{
"declarator": "userRequestValidator = new UserRequestValidator()",
"modifier": "private static final",
"original_string": "private static final UserRequestValidator userRequestValidator = new UserRequestValidator();",
"type": "UserRequestValidator",
"var_name": "userR... | {
"body": "@Test\n public void testValidateFieldsNotAllowedFailure() {\n Request request = initailizeRequest();\n Map<String, Object> requestObj = request.getRequest();\n requestObj.put(JsonKey.PROVIDER, \"AP\");\n request.setRequest(requestObj);\n try {\n userRequestValidator.fieldsNotAllowed(\n... | {
"fields": [
{
"declarator": "ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode()",
"modifier": "private static final",
"original_string": "private static final int ERROR_CODE = ResponseCode.CLIENT_ERROR.getResponseCode();",
"type": "int",
"var_name": "ERROR_CODE"
}
],
... | {
"body": "public void fieldsNotAllowed(List<String> fields, Request userRequest) {\n for (String field : fields) {\n if (((userRequest.getRequest().get(field) instanceof String)\n && StringUtils.isNotBlank((String) userRequest.getRequest().get(field)))\n || (null != userRequest.getReque... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_254 | {
"fields": [
{
"declarator": "propertiesCache = ProjectUtil.propertiesCache",
"modifier": "private",
"original_string": "private PropertiesCache propertiesCache = ProjectUtil.propertiesCache;",
"type": "PropertiesCache",
"var_name": "propertiesCache"
},
{
"declarator":... | {
"body": "@Test\n public void testGetContextFailureWithoutActionUrl() {\n\n Map<String, Object> templateMap = new HashMap<>();\n templateMap.put(JsonKey.NAME, \"userName\");\n\n VelocityContext context = ProjectUtil.getContext(templateMap);\n assertEquals(false, context.internalContainsKey(JsonKey.ACTIO... | {
"fields": [
{
"declarator": "atomicInteger = new AtomicInteger()",
"modifier": "private static",
"original_string": "private static AtomicInteger atomicInteger = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "atomicInteger"
},
{
"declarator": "DEFAULT_BA... | {
"body": "public static VelocityContext getContext(Map<String, Object> map) {\n propertiesCache = PropertiesCache.getInstance();\n VelocityContext context = new VelocityContext();\n if (StringUtils.isNotBlank((String) map.get(JsonKey.ACTION_URL))) {\n context.put(JsonKey.ACTION_URL, getValue(map, JsonK... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
96123627_311 | {
"fields": [
{
"declarator": "iterator",
"modifier": "private static",
"original_string": "private static Iterator iterator;",
"type": "Iterator",
"var_name": "iterator"
},
{
"declarator": "row",
"modifier": "private static",
"original_string": "private sta... | {
"body": "@Test\n public void testUpdateRecordFailureWithInvalidProperty() throws Exception {\n\n dummyAddress.put(JsonKey.CITY, \"city\");\n dummyAddress.put(JsonKey.ADD_TYPE, \"addrType\");\n\n when(session.prepare(Mockito.anyString()))\n .thenThrow(\n new ProjectCommonException(\n ... | {
"fields": [
{
"declarator": "connectionManager",
"modifier": "protected",
"original_string": "protected CassandraConnectionManager connectionManager;",
"type": "CassandraConnectionManager",
"var_name": "connectionManager"
}
],
"file": "sunbird-cassandra-utils/src/main/java/... | {
"body": "@Override\n public Response updateRecord(String keyspaceName, String tableName, Map<String, Object> request) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"Cassandra Service updateRecord method started at ==\" + startTime, LoggerEnum.INFO);\n Response response = ... | {
"created": null,
"fork": null,
"fork_count": 42,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 96123627,
"size": 62845,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/project-sunbird/sunbird-utils"
} |
6944525_150 | {
"fields": [],
"file": "restli-client/src/test/java/com/linkedin/restli/client/TestRequest.java",
"identifier": "TestRequest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHeadersCaseInsensitiveGet()\n {\n final long id = 42l;\n GetRequestBuilder<Long, TestRecord> builder = generateDummyRequestBuilder();\n Request<TestRecord> request = builder.id(id).addHeader(\"header\", \"value\").build();\n Assert.assertEquals(request.getHeaders().get... | {
"fields": [
{
"declarator": "SLASH_PATTERN = Pattern.compile(\"/\")",
"modifier": "private static final",
"original_string": "private static final Pattern SLASH_PATTERN = Pattern.compile(\"/\");",
"type": "Pattern",
"var_name": "SLASH_PATTERN"
},
{
"declarator": "URI_... | {
"body": "public Map<String, String> getHeaders()\n {\n return _headers;\n }",
"class_method_signature": "Request.getHeaders()",
"constructor": false,
"full_signature": "public Map<String, String> getHeaders()",
"identifier": "getHeaders",
"invocations": [],
"modifiers": "public",
"parameters": "(... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_500 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/methods/arguments/TestArgumentBuilder.java",
"identifier": "TestArgumentBuilder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRestLiAttachmentsParam()\n {\n ServerResourceContext mockResourceContext = EasyMock.createMock(ServerResourceContext.class);\n\n final RestLiAttachmentReader restLiAttachmentReader = new RestLiAttachmentReader(null);\n\n EasyMock.expect(mockResourceContext.getRequestAttac... | {
"fields": [],
"file": "restli-server/src/main/java/com/linkedin/restli/internal/server/methods/arguments/ArgumentBuilder.java",
"identifier": "ArgumentBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArgumentBuilder.buildArgs(final Object[] positionalArguments,\n ... | {
"body": "@SuppressWarnings(\"deprecation\")\n static Object[] buildArgs(final Object[] positionalArguments,\n final ResourceMethodDescriptor resourceMethod,\n final ServerResourceContext context,\n final DynamicRe... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_445 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/TestResourceContextImpl.java",
"identifier": "TestResourceContextImpl",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemoveCustomContextData() throws RestLiSyntaxException\n {\n final ResourceContextImpl context = new ResourceContextImpl();\n String bar = \"bar\";\n context.putCustomContextData(\"foo\", bar);\n Optional<Object> barRemove = context.removeCustomContextData(\"foo\");\n ... | {
"fields": [
{
"declarator": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1",
"modifier": "private static final",
"original_string": "private static final int INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY = 1;",
"type": "int",
"var_name": "INITIAL_CUSTOM_REQUEST_CONTEXT_CAPACITY"
},
... | {
"body": "@Override\n public Optional<Object> removeCustomContextData(String key)\n {\n return getCustomContextData(key).isPresent() ? Optional.of(_customRequestContext.remove(key)) : Optional.empty();\n }",
"class_method_signature": "ResourceContextImpl.removeCustomContextData(String key)",
"constructor":... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_296 | {
"fields": [],
"file": "r2-core/src/test/java/com/linkedin/r2/util/TestLinkedDeque.java",
"identifier": "TestLinkedDeque",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOfferLast()\n {\n List<Integer> control = new ArrayList<Integer>(Arrays.asList(1, 2, 3));\n LinkedDeque<Integer> q = new LinkedDeque<Integer>(control);\n\n control.add(99);\n Assert.assertTrue(q.offerLast(99));\n\n Assert.assertEquals(q, control);\n }",
"class_me... | {
"fields": [
{
"declarator": "_head",
"modifier": "private",
"original_string": "private Node<T> _head;",
"type": "Node<T>",
"var_name": "_head"
},
{
"declarator": "_tail",
"modifier": "private",
"original_string": "private Node<T> _tail;",
"type": "N... | {
"body": "@Override\n public boolean offerLast(T t)\n {\n addLastNode(t);\n return true;\n }",
"class_method_signature": "LinkedDeque.offerLast(T t)",
"constructor": false,
"full_signature": "@Override public boolean offerLast(T t)",
"identifier": "offerLast",
"invocations": [
"addLastNode"
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_629 | {
"fields": [
{
"declarator": "PSON_DATA_CODEC = new PsonDataCodec()",
"modifier": "private static final",
"original_string": "private static final PsonDataCodec PSON_DATA_CODEC = new PsonDataCodec();",
"type": "PsonDataCodec",
"var_name": "PSON_DATA_CODEC"
},
{
"declar... | {
"body": "@Test\n public void testPSONByteStringToDataMap() throws MimeTypeParseException, IOException\n {\n DataMap expectedDataMap = createTestDataMap();\n ByteString byteString = ByteString.copy(PSON_DATA_CODEC.mapToBytes(expectedDataMap));\n DataMap dataMap = bytesToDataMap(\"application/x-pson\", byt... | {
"fields": [],
"file": "restli-common/src/main/java/com/linkedin/restli/internal/common/DataMapConverter.java",
"identifier": "DataMapConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "DataMapConverter.dataMapToByteString(Map<String, String> headers, DataMap dataMap)",
"c... | {
"body": "public static DataMap bytesToDataMap(Map<String, String> headers, ByteString bytes) throws MimeTypeParseException, IOException\n {\n return getContentType(headers).getCodec().readMap(bytes);\n }",
"class_method_signature": "DataMapConverter.bytesToDataMap(Map<String, String> headers, ByteString byte... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_64 | {
"fields": [
{
"declarator": "referenceList1 = new ArrayList<Object>()",
"modifier": "final static",
"original_string": "final static List<Object> referenceList1 = new ArrayList<Object>();",
"type": "List<Object>",
"var_name": "referenceList1"
},
{
"declarator": "RL1_B... | {
"body": "@Test\n public void testDump()\n {\n StringBuilder sb1 = new StringBuilder();\n Data.dump(\"map\", referenceDataMap1, \" \", sb1);\n assertEquals(sb1.toString(), referenceDump1);\n assertEquals(Data.dump(\"map\", referenceDataMap1, \" \").toString(), referenceDump1);\n\n StringBuilder sb... | {
"fields": [
{
"declarator": "NULL = Null.getInstance()",
"modifier": "public static final",
"original_string": "public static final Null NULL = Null.getInstance();",
"type": "Null",
"var_name": "NULL"
},
{
"declarator": "UTF_8_CHARSET = Charset.forName(\"UTF-8\")",
... | {
"body": "public static void dump(String name, Object obj, String prefix, StringBuilder builder)\n {\n try\n {\n traverse(obj, new DumpTraverseCallback(name, prefix, builder));\n }\n catch (IOException e)\n {\n builder.append(\"( Exception: \").append(e).append(\" )\");\n }\n }",
"cla... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_279 | {
"fields": [
{
"declarator": "ITEM = new Object()",
"modifier": "private static final",
"original_string": "private static final Object ITEM = new Object();",
"type": "Object",
"var_name": "ITEM"
}
],
"file": "r2-core/src/test/java/com/linkedin/r2/transport/common/bridge/com... | {
"body": "@Test(timeOut = 1000L)\n public void testGet() throws Exception\n {\n FutureTransportCallback<Object> futureTransportCallback = new FutureTransportCallback<>();\n\n // At this time the future is neither done or cancelled\n Assert.assertFalse(futureTransportCallback.isDone());\n Assert.assertF... | {
"fields": [
{
"declarator": "_futureCallback = new FutureCallback<>()",
"modifier": "private final",
"original_string": "private final FutureCallback<TransportResponse<T>> _futureCallback = new FutureCallback<>();",
"type": "FutureCallback<TransportResponse<T>>",
"var_name": "_futu... | {
"body": "@Override\n public TransportResponse<T> get() throws InterruptedException, ExecutionException {\n return _futureCallback.get();\n }",
"class_method_signature": "FutureTransportCallback.get()",
"constructor": false,
"full_signature": "@Override public TransportResponse<T> get()",
"identifier": ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_557 | {
"fields": [
{
"declarator": "CODEC = new JacksonDataCodec()",
"modifier": "private static final",
"original_string": "private static final JacksonDataCodec CODEC = new JacksonDataCodec();",
"type": "JacksonDataCodec",
"var_name": "CODEC"
},
{
"declarator": "MAXIMUM_RE... | {
"body": "@Test(dataProvider = \"multiplexerConfigurations\")\n public void testHandleParallelRequests(MultiplexerRunMode multiplexerRunMode) throws Exception\n {\n SynchronousRequestHandler mockHandler = createMockHandler();\n MultiplexedRequestHandlerImpl multiplexer = createMultiplexer(mockHandler, multip... | {
"fields": [
{
"declarator": "MUX_PLAN_CLASS = \"mux\"",
"modifier": "private static final",
"original_string": "private static final String MUX_PLAN_CLASS = \"mux\";",
"type": "String",
"var_name": "MUX_PLAN_CLASS"
},
{
"declarator": "MUX_URI_PATH = \"/mux\"",
"... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, final Callback<RestResponse> callback)\n {\n if (HttpMethod.POST != HttpMethod.valueOf(request.getMethod()))\n {\n _log.error(\"POST is expected, but \" + request.getMethod() + \" received\");\n call... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_107 | {
"fields": [],
"file": "restli-client-util-recorder/src/test/java/com/linkedin/restli/client/util/TestPatchTreeRecorder.java",
"identifier": "TestPatchTreeRecorder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMethodsInheritedFromObjectOnProxy()\n {\n PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();\n PatchTreeTestModel testModel = pc.getRecordingProxy();\n\n Assert.assertEquals(testModel.hashCode(), testModel.hashCode());\n Assert.assertNotNull(testModel.toString());\n... | {
"fields": [
{
"declarator": "_templateProxy",
"modifier": "private final",
"original_string": "private final T _templateProxy;",
"type": "T",
"var_name": "_templateProxy"
},
{
"declarator": "_patchTree",
"modifier": "private final",
"original_string": "pri... | {
"body": "public T getRecordingProxy()\n {\n return _templateProxy;\n }",
"class_method_signature": "PatchTreeRecorder.getRecordingProxy()",
"constructor": false,
"full_signature": "public T getRecordingProxy()",
"identifier": "getRecordingProxy",
"invocations": [],
"modifiers": "public",
"paramet... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_412 | {
"fields": [],
"file": "d2/src/test/java/com/linkedin/d2/balancer/clients/DynamicClientTest.java",
"identifier": "DynamicClientTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void testShutdown() throws URISyntaxException,\n InterruptedException\n {\n LoadBalancerMock balancer = new LoadBalancerMock(true);\n DynamicClient client = new DynamicClient(balancer, null, true);\n final CountDownLatch latch = new Count... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(DynamicClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger _log = LoggerFactory.getLogger(DynamicClient.class);",
"type": "Logger",
"var_name": "_log"
},
{
"dec... | {
"body": "@Override\n public void shutdown(final Callback<None> callback)\n {\n info(_log, \"shutting down dynamic client\");\n\n _balancer.shutdown(() -> {\n info(_log, \"dynamic client shutdown complete\");\n\n callback.onSuccess(None.none());\n });\n }",
"class_method_signature": "DynamicC... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_691 | {
"fields": [
{
"declarator": "_photoRes",
"modifier": "private",
"original_string": "private PhotoResource _photoRes;",
"type": "PhotoResource",
"var_name": "_photoRes"
},
{
"declarator": "_albumRes",
"modifier": "private",
"original_s... | {
"body": "@Test\n public void testResourcePurge()\n {\n // we put 2 photos in album 2; delete them\n Assert.assertEquals(_entryRes.purge(Long.valueOf(2), null), 2);\n }",
"class_method_signature": "TestAlbumEntryResource.testResourcePurge()",
"constructor": false,
"full_signature": "@Test public void ... | {
"fields": [
{
"declarator": "_db",
"modifier": "@Inject\n @Named(\"albumEntryDb\")\n private",
"original_string": "@Inject\n @Named(\"albumEntryDb\")\n private AlbumEntryDatabase _db;",
"type": "AlbumEntryDatabase",
"var_name": "_db"
},
{
"declarator": "_photoDb",... | {
"body": "public static int purge(AlbumEntryDatabase db, Long albumId, Long photoId)\n {\n // purge 1 entry\n if (albumId != null && photoId != null)\n {\n CompoundKey key = new CompoundKey().append(\"photoId\", photoId).append(\"albumId\", albumId);\n final boolean isRemoved = (db.getData().remo... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_384 | {
"fields": [
{
"declarator": "_executorService",
"modifier": "private",
"original_string": "private ScheduledExecutorService _executorService;",
"type": "ScheduledExecutorService",
"var_name": "_executorService"
},
{
"de... | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void testRefreshServiceStrategies() throws URISyntaxException, InterruptedException\n {\n reset();\n\n URI uri = URI.create(\"http://cluster-1/test\");\n List<String> schemes = new ArrayList<String>();\n Map<URI, Double> weights = new HashM... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(SimpleLoadBalancerState.class)",
"modifier": "private static final",
"original_string": "private static final Logger _log = LoggerFactory.getLogger(SimpleLoadBalancerState.cla... | {
"body": "void refreshServiceStrategies(ServiceProperties serviceProperties)\n {\n info(_log, \"refreshing service strategies for service: \", serviceProperties);\n\n Map<String, LoadBalancerStrategy> newStrategies = createNewStrategies(serviceProperties);\n\n Map<String, LoadBalancerStrategy> oldStrategie... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_33 | {
"fields": [
{
"declarator": "_symbolTableName = \"https://someservice:100|tableName\"",
"modifier": "private final",
"original_string": "private final String _symbolTableName = \"https://someservice:100|tableName\";",
"type": "String",
"var_name": "_symbolTableName"
},
{
... | {
"body": "@Test(expectedExceptions = IllegalStateException.class)\n public void testLocalSymbolTableFailure()\n {\n DefaultSymbolTableProvider provider = new DefaultSymbolTableProvider();\n provider.getSymbolTable(\"random\");\n }",
"class_method_signature": "TestDefaultSymbolTableProvider.testLocalSymbol... | {
"fields": [
{
"declarator": "METADATA_EXTRACTOR = new SymbolTableMetadataExtractor()",
"modifier": "private static final",
"original_string": "private static final SymbolTableMetadataExtractor METADATA_EXTRACTOR = new SymbolTableMetadataExtractor();",
"type": "SymbolTableMetadataExtracto... | {
"body": "@Override\n public SymbolTable getSymbolTable(String symbolTableName)\n {\n try\n {\n SymbolTableMetadata metadata = METADATA_EXTRACTOR.extractMetadata(symbolTableName);\n String serverNodeUri = metadata.getServerNodeUri();\n String tableName = metadata.getSymbolTableName();\n b... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_111 | {
"fields": [],
"file": "restli-client-util-recorder/src/test/java/com/linkedin/restli/client/util/TestPatchTreeRecorder.java",
"identifier": "TestPatchTreeRecorder",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expectedExceptions = IllegalArgumentException.class)\n public void testPropagateIntoUnsupportedComplexType()\n {\n PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();\n pc.getRecordingProxy().getFooUnion();\n }",
"class_method_signature": "TestPatchTreeRecorder.testPropagateIntoUnsupport... | {
"fields": [
{
"declarator": "_templateProxy",
"modifier": "private final",
"original_string": "private final T _templateProxy;",
"type": "T",
"var_name": "_templateProxy"
},
{
"declarator": "_patchTree",
"modifier": "private final",
"original_string": "pri... | {
"body": "public T getRecordingProxy()\n {\n return _templateProxy;\n }",
"class_method_signature": "PatchTreeRecorder.getRecordingProxy()",
"constructor": false,
"full_signature": "public T getRecordingProxy()",
"identifier": "getRecordingProxy",
"invocations": [],
"modifiers": "public",
"paramet... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_541 | {
"fields": [
{
"declarator": "filterRequestContext",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private FilterRequestContext filterRequestContext;",
"type": "FilterRequestContext",
"var_name": "filterRequestContext"
},
{
"declarator": "filterResponseC... | {
"body": "@Test(dataProvider = \"errorResponseValidationDataProvider\")\n public void testErrorResponseValidation(List<ServiceError> resourceServiceErrors,\n List<ServiceError> methodServiceErrors, HttpStatus httpStatus, String serviceErrorCode,\n RecordTemplate errorDetails, HttpStatus expectedHttpStatus... | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Server encountered an unexpected condition that prevented it from fulfilling the request\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Server encountered an unexpected condition that prev... | {
"body": "@Override\n public CompletableFuture<Void> onError(Throwable throwable, final FilterRequestContext requestContext,\n final FilterResponseContext responseContext)\n {\n CompletableFuture<Void> future = new CompletableFuture<>();\n\n if (throwable instanceof RestLiServiceException)\n {\n ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_404 | {
"fields": [
{
"declarator": "CONTENT = ByteString.copy(new byte[8092])",
"modifier": "private static final",
"original_string": "private static final ByteString CONTENT = ByteString.copy(new byte[8092]);",
"type": "ByteString",
"var_name": "CONTENT"
},
{
"declarator":... | {
"body": "@Test\n public void testRestRetry() throws Exception\n {\n SimpleLoadBalancer balancer = prepareLoadBalancer(Arrays.asList(\"http://test.linkedin.com/retry1\", \"http://test.linkedin.com/good\"));\n\n DynamicClient dynamicClient = new DynamicClient(balancer, null);\n RetryClient client = new Ret... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(RetryClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(RetryClient.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "@Override\n public Future<RestResponse> restRequest(RestRequest request)\n {\n return restRequest(request, new RequestContext());\n }",
"class_method_signature": "RetryClient.restRequest(RestRequest request)",
"constructor": false,
"full_signature": "@Override public Future<RestResponse> restRe... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_687 | {
"fields": [
{
"declarator": "_photoRes",
"modifier": "private",
"original_string": "private PhotoResource _photoRes;",
"type": "PhotoResource",
"var_name": "_photoRes"
},
{
"declarator": "_albumRes",
"modifier": "private",
"original_s... | {
"body": "@Test(expectedExceptions = RestLiServiceException.class)\n public void testBadUpdateAlbumId()\n {\n // album 100 doesn't exist\n CompoundKey key = new CompoundKey().append(\"photoId\", 1L).append(\"albumId\", 100L);\n AlbumEntry entry = new AlbumEntry().setAddTime(4);\n _entryRes.update(key, ... | {
"fields": [
{
"declarator": "_db",
"modifier": "@Inject\n @Named(\"albumEntryDb\")\n private",
"original_string": "@Inject\n @Named(\"albumEntryDb\")\n private AlbumEntryDatabase _db;",
"type": "AlbumEntryDatabase",
"var_name": "_db"
},
{
"declarator": "_photoDb",... | {
"body": "@Override\n @SuccessResponse(statuses = { HttpStatus.S_204_NO_CONTENT })\n @ServiceErrors(INVALID_PERMISSIONS)\n @ParamError(code = INVALID_ID, parameterNames = { \"albumEntryId\" })\n public UpdateResponse update(CompoundKey key, AlbumEntry entity)\n {\n long photoId = (Long) key.getPart(\"photoId... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_668 | {
"fields": [],
"file": "restli-common/src/test/java/com/linkedin/restli/internal/common/TestQueryParamsDataMap.java",
"identifier": "TestQueryParamsDataMap",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProcessProjections()\n {\n //Construct a MaskTree from a series of PathSpecs. Extract the subsequent Datamap representation.\n final MaskTree rootObjectsMask = MaskCreator\n .createPositiveMask(new PathSpec(\"foo\", PathSpec.WILDCARD, \"bar\"));\n\n final MaskTree ... | {
"fields": [
{
"declarator": "SEGMENT_DELIMITER_PATTERN =\n Pattern.compile(Pattern.quote(PathSegment.PATH_SEPARATOR))",
"modifier": "private static final",
"original_string": "private static final Pattern SEGMENT_DELIMITER_PATTERN =\n... | {
"body": "public static DataMap processProjections(DataMap dataMap, Map<String, List<String>> result)\n {\n //We send this through the pipeline and migrate from the dataMap into the result\n for (final String parameterName : RestConstants.PROJECTION_PARAMETERS)\n {\n if (dataMap.containsKey(parameterN... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_25 | {
"fields": [],
"file": "r2-disruptor/src/test/java/com/linkedin/r2/disruptor/TestDisruptContexts.java",
"identifier": "TestDisruptContexts",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testLatency()\n {\n final long latency = 4200;\n DisruptContexts.DelayDisruptContext context =\n (DisruptContexts.DelayDisruptContext) DisruptContexts.delay(latency);\n\n Assert.assertEquals(context.mode(), DisruptMode.DELAY);\n Assert.assertEquals(context.delay(), ... | {
"fields": [],
"file": "r2-disruptor/src/main/java/com/linkedin/r2/disruptor/DisruptContexts.java",
"identifier": "DisruptContexts",
"interfaces": "",
"methods": [
{
"class_method_signature": "DisruptContexts.delay(long delay)",
"constructor": false,
"full_signature": "public static Dis... | {
"body": "public static DisruptContext delay(long delay)\n {\n if (delay < 0)\n {\n throw new IllegalArgumentException(\"Delay cannot be smaller than 0\");\n }\n return new DelayDisruptContext(delay);\n }",
"class_method_signature": "DisruptContexts.delay(long delay)",
"constructor": false,
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_392 | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Test\n public void testGetPartitionInfoOrdering()\n throws Exception\n {\n String serviceName = \"articles\";\n String clusterName = \"cluster\";\n String path = \"path\";\n String strategyName = \"degrader\";\n\n // setup 3 partitions. Partition 1 and Partition 2 both have server1 - s... | {
"fields": [
{
"declarator": "HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\"",
"modifier": "private static final",
"original_string": "private static final String HOST_OVERRIDE_LIST = \"HOST_OVERRIDE_LIST\";",
"type": "String",
"var_name": "HOST_OVERRIDE_LIST"
},
{
"decla... | {
"body": "@Override\n public <K> HostToKeyMapper<K> getPartitionInformation(URI serviceUri, Collection<K> keys,\n int limitHostPerPartition,\n int hash)\n throws ServiceUnavailableException\n {\n ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_238 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "private static final",
"original_string": "private static final String FS = File.separator;",
"type": "String",
"var_name": "FS"
},
{
"declarator": "RESOURCES_DIR = \"src\" + FS + \"test\" + FS + \"resour... | {
"body": "@Test\n public void testFileNotFound()\n {\n final String nonExistentFilename1 = \"NonExistentFile1\";\n final String nonExistentFilename2 = \"NonExistentFile2\";\n final Collection<CompatibilityInfo> testIncompatibles = new HashSet<CompatibilityInfo>();\n final Collection<CompatibilityInfo> ... | {
"fields": [
{
"declarator": "_resolverPath",
"modifier": "private",
"original_string": "private String _resolverPath;",
"type": "String",
"var_name": "_resolverPath"
},
{
"declarator": "_infoMap = new CompatibilityInfoMap()",
"modifier": "private final",
"... | {
"body": "public CompatibilityInfoMap check(String prevSnapshotPath, String currSnapshotPath, CompatibilityLevel compatLevel)\n {\n return checkCompatibility(prevSnapshotPath, currSnapshotPath, compatLevel, false);\n }",
"class_method_signature": "RestLiSnapshotCompatibilityChecker.check(String prevSnapshotPa... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_516 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/response/TestErrorResponseBuilder.java",
"identifier": "TestErrorResponseBuilder",
"interfaces": "",
"superclass": ""
} | {
"body": "@SuppressWarnings(\"deprecation\")\n @Test\n public void testExceptionClass()\n {\n ErrorResponseBuilder builder = new ErrorResponseBuilder();\n RestLiServiceException exception = new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, \"foobar\", new IllegalStateException(\"foo\"));\n excepti... | {
"fields": [
{
"declarator": "DEFAULT_INTERNAL_ERROR_MESSAGE = \"INTERNAL SERVER ERROR\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_INTERNAL_ERROR_MESSAGE = \"INTERNAL SERVER ERROR\";",
"type": "String",
"var_name": "DEFAULT_INTERNAL_... | {
"body": "public ErrorResponse buildErrorResponse(RestLiServiceException result)\n {\n return buildErrorResponse(result, result.hasOverridingErrorResponseFormat() ? result.getOverridingFormat() : _errorResponseFormat);\n }",
"class_method_signature": "ErrorResponseBuilder.buildErrorResponse(RestLiServiceExcep... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_146 | {
"fields": [
{
"declarator": "TARGET_HOST_KEY_NAME = \"D2-KeyMapper-TargetHost\"",
"modifier": "private static final",
"original_string": "private static final String TARGET_HOST_KEY_NAME = \"D2-KeyMapper-TargetHost\";",
"type": "String",
"var_name": "TARGET_HOST_KEY_NAME"
},
... | {
"body": "@Test(dataProvider = \"scatterBatchRequestProvider\")\n public void testScatterRequest(Request<?> request,\n Request<?> firstRequest,\n URI firstHost,\n Request<?> secondRequest,\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DefaultScatterGatherStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DefaultScatterGatherStrategy.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@Deprecated\n @Override\n public <K, T> List<RequestInfo> scatterRequest(Request<T> request, RequestContext requestContext,\n Map<URI, Set<K>> mappedKeys)\n {\n return defaultScatterRequestImpl(request, requestContext, mappedKeys);\n }",
"class_metho... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_453 | {
"fields": [],
"file": "restli-server/src/test/java/com/linkedin/restli/internal/server/util/TestArgumentUtils.java",
"identifier": "TestArgumentUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(dataProvider = \"parseReturnEntityParameterData\")\n public void testParseReturnEntityParameter(String paramValue, Boolean expectedValue, boolean expectException)\n {\n try\n {\n boolean value = ArgumentUtils.parseReturnEntityParameter(paramValue);\n\n if (expectException)\n {\... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(ArgumentUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger _log = LoggerFactory.getLogger(ArgumentUtils.class);",
"type": "Logger",
"var_name": "_log"
},
{
"dec... | {
"body": "public static boolean parseReturnEntityParameter(final String value)\n {\n switch (value.toLowerCase()) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST, String.format(\"Inv... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_280 | {
"fields": [
{
"declarator": "ITEM = new Object()",
"modifier": "private static final",
"original_string": "private static final Object ITEM = new Object();",
"type": "Object",
"var_name": "ITEM"
}
],
"file": "r2-core/src/test/java/com/linkedin/r2/transport/common/bridge/com... | {
"body": "@Test(timeOut = 1000L, expectedExceptions = TimeoutException.class)\n public void testGetTimeout() throws Exception\n {\n FutureTransportCallback<Object> futureTransportCallback = new FutureTransportCallback<>();\n futureTransportCallback.get(0, TimeUnit.MILLISECONDS);\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "_futureCallback = new FutureCallback<>()",
"modifier": "private final",
"original_string": "private final FutureCallback<TransportResponse<T>> _futureCallback = new FutureCallback<>();",
"type": "FutureCallback<TransportResponse<T>>",
"var_name": "_futu... | {
"body": "@Override\n public TransportResponse<T> get() throws InterruptedException, ExecutionException {\n return _futureCallback.get();\n }",
"class_method_signature": "FutureTransportCallback.get()",
"constructor": false,
"full_signature": "@Override public TransportResponse<T> get()",
"identifier": ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_72 | {
"fields": [],
"file": "data/src/test/java/com/linkedin/data/schema/TestDataSchema.java",
"identifier": "TestDataSchema",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEnumDataSchema() throws Exception\n {\n final String schemaString = \"{ \\\"type\\\" : \\\"enum\\\", \\\"name\\\" : \\\"numbers\\\", \\\"symbols\\\" : [ \\\"ONE\\\", \\\"TWO\\\", \\\"THREE\\\", \\\"FOUR\\\", \\\"FIVE\\\"], \\\"symbolDocs\\\" : { \\\"FIVE\\\" : \\\"DOC_FIVE\\\",... | {
"fields": [
{
"declarator": "_type",
"modifier": "private final",
"original_string": "private final Type _type;",
"type": "Type",
"var_name": "_type"
},
{
"declarator": "_resolvedProperties = new HashMap<>()",
"modifier": "",
"original_string": "Map<String... | {
"body": "@Override\n public abstract boolean equals(Object other);",
"class_method_signature": "DataSchema.equals(Object other)",
"constructor": false,
"full_signature": "@Override public abstract boolean equals(Object other)",
"identifier": "equals",
"invocations": [],
"modifiers": "@Override public a... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_428 | {
"fields": [
{
"declarator": "DEFAULT_PARTITION_ID = DefaultPartitionAccessor.DEFAULT_PARTITION_ID",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_PARTITION_ID = DefaultPartitionAccessor.DEFAULT_PARTITION_ID;",
"type": "int",
"var_name": "D... | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void testFactoryWithNoneHashConfig() {\n RingFactory<String> factory = new DelegatingRingFactory<>(configBuilder(null, null));\n Ring<String> ring = factory.createRing(buildPointsMap(10));\n\n assertTrue(ring instanceof DistributionNonDiscreteR... | {
"fields": [
{
"declarator": "POINT_BASED_CONSISTENT_HASH = \"pointBased\"",
"modifier": "public static final",
"original_string": "public static final String POINT_BASED_CONSISTENT_HASH = \"pointBased\";",
"type": "String",
"var_name": "POINT_BASED_CONSISTENT_HASH"
},
{
... | {
"body": "@Override\n public Ring<T> createRing(Map<T, Integer> pointsMap) {\n return _ringFactory.createRing(pointsMap);\n }",
"class_method_signature": "DelegatingRingFactory.createRing(Map<T, Integer> pointsMap)",
"constructor": false,
"full_signature": "@Override public Ring<T> createRing(Map<T, Integ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_582 | {
"fields": [
{
"declarator": "DEBUG_HANDLER_RESPONSE_A = \"Response A\"",
"modifier": "private static final",
"original_string": "private static final String DEBUG_HANDLER_RESPONSE_A = \"Response A\";",
"type": "String",
"var_name": "DEBUG_HANDLER_RESPONSE_A"
},
{
"dec... | {
"body": "@Test\n public void testRestRequestResponseAttachmentsDesired() throws Exception\n {\n //This test verifies that a RestRequest sent to the RestLiServer throws an exception if the accept type\n //includes multipart related\n RestRequest acceptTypeMultiPartRelated = new RestRequestBuilder(new URI(... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RestLiServer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RestLiServer.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)\n {\n //This code path cannot accept content types or accept types that contain\n //multipart/related. This is because these types of requests will usually have very large payl... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_214 | {
"fields": [],
"file": "restli-tools/src/test/java/com/linkedin/restli/tools/data/TestPredicateExpressionParser.java",
"identifier": "TestPredicateExpressionParser",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOperandNotMissingOperandOr()\n {\n PredicateExpressionParser.parse(\"com.linkedin.data.it.AlwaysTruePredicate ! | com.linkedin.data.it.AlwaysFalsePredicate\");\n }",
"class_method_signature": "TestPredicateExpressionParser.testOperandNotMissingOperandOr()",
"constructor": ... | {
"fields": [
{
"declarator": "TRIMMER_PATTERN = Pattern.compile(\"\\\\s\")",
"modifier": "private static final",
"original_string": "private static final Pattern TRIMMER_PATTERN = Pattern.compile(\"\\\\s\");",
"type": "Pattern",
"var_name": "TRIMMER_PATTERN"
},
{
"decl... | {
"body": "public static Predicate parse(String expression)\n {\n final Stack<Predicate> predicateStack = new Stack<Predicate>();\n final Stack<Character> operatorStack = new Stack<Character>();\n\n final String trimmedExpression = TRIMMER_PATTERN.matcher(expression).replaceAll(\"\");\n final StringToken... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_644 | {
"fields": [
{
"declarator": "cookieA",
"modifier": "private",
"original_string": "private HttpCookie cookieA;",
"type": "HttpCookie",
"var_name": "cookieA"
},
{
"declarator": "cookieB",
"modifier": "private",
"original_string": "private HttpCookie cookieB;... | {
"body": "@Test\n public void testDecodeMultipleCookiewWithAttr()\n {\n String combinedHeader = cookieA.toString() + \";\" + cookieC.toString() + \";\" + cookieD.toString();\n List<HttpCookie> cookies = Arrays.asList(cookieA, cookieC, cookieD);\n Assert.assertEquals(CookieUtil.decodeCookies(Collections.si... | {
"fields": [],
"file": "restli-common/src/main/java/com/linkedin/restli/internal/common/CookieUtil.java",
"identifier": "CookieUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "CookieUtil.encodeCookies(List<HttpCookie> cookies)",
"constructor": false,
"full_signature": ... | {
"body": "public static List<HttpCookie> decodeCookies(List<String> cookieStrs)\n {\n List<HttpCookie> cookies = new ArrayList<HttpCookie>();\n if (cookieStrs == null)\n {\n return cookies;\n }\n\n for (String cookieStr : cookieStrs)\n {\n if (cookieStr == null)\n {\n continu... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_351 | {
"fields": [],
"file": "d2/src/test/java/com/linkedin/d2/balancer/util/hashing/ConsistentHashRingTest.java",
"identifier": "ConsistentHashRingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(groups = { \"small\", \"back-end\" })\n public void testZeroItems()\n {\n Map<String, Integer> zero = new HashMap<String, Integer>();\n ConsistentHashRing<String> test = new ConsistentHashRing<String>(zero);\n\n assertNull(test.get(0));\n\n zero.put(\"test\", 0);\n test = new Consist... | {
"fields": [
{
"declarator": "_log = LoggerFactory.getLogger(ConsistentHashRing.class)",
"modifier": "private static final",
"original_string": "private static final Logger _log = LoggerFactory.getLogger(ConsistentHashRing.class);",
"type": "Logger",
"var_name": "_log"
},
{... | {
"body": "public T get(int key)\n {\n if (_points.isEmpty())\n {\n debug(_log, \"get called on a hash ring with nothing in it\");\n\n return null;\n }\n\n int index = getIndex(key);\n\n return _points.get(index).getT();\n }",
"class_method_signature": "ConsistentHashRing.get(int key)",
... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_185 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "private static final",
"original_string": "private static final String FS = File.separator;",
"type": "String",
"var_name": "FS"
},
{
"declarator": "SOURCE_ROOT = String.join(FS, \"src\", \"test\", \"reso... | {
"body": "@Test(dataProvider = \"fullClassName\")\n public void testTranslatePdscFromConvertedPdlInSchema(String packageName, String className) throws Exception\n {\n FileUtil.FileExtensionFilter pdscFilter = new FileUtil.FileExtensionFilter(SchemaParser.FILE_EXTENSION);\n FileUtil.FileExtensionFilter pdlFil... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SchemaFormatTranslator.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaFormatTranslator.class);",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "public static void main(String[] args) throws Exception\n {\n try\n {\n final CommandLineParser parser = new GnuParser();\n CommandLine cl = parser.parse(OPTIONS, args);\n\n if (cl.hasOption('h'))\n {\n help();\n System.exit(0);\n }\n\n String sourceFormat... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_490 | {
"fields": [
{
"declarator": "_mockRestLiRequestData",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private RestLiRequestData _mockRestLiRequestData;",
"type": "RestLiRequestData",
"var_name": "_mockRestLiRequestData"
},
{
"declarator": "_mockFilterChai... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testFilterInvocationRequestThrowsError() throws Exception\n {\n _restLiFilterChain = new RestLiFilterChain(Arrays.asList(_filters),\n _mockFilterChainDispatcher, _mockFilterChainCallback);\n _filters[1] = new CountFilterRequestThrowsErr... | {
"fields": [
{
"declarator": "_filterChainIterator",
"modifier": "private final",
"original_string": "private final RestLiFilterChainIterator _filterChainIterator;",
"type": "RestLiFilterChainIterator",
"var_name": "_filterChainIterator"
}
],
"file": "restli-server/src/main/... | {
"body": "public void onRequest(FilterRequestContext requestContext,\n RestLiFilterResponseContextFactory filterResponseContextFactory)\n {\n // Initiate the filter chain iterator. The RestLiCallback will be passed to the method invoker at the end of the\n // filter chain.\n _filterC... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_613 | {
"fields": [],
"file": "restli-common/src/test/java/com/linkedin/restli/common/TestIdResponse.java",
"identifier": "TestIdResponse",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString()\n {\n IdResponse<Long> longIdResponse = new IdResponse<Long>(6L);\n longIdResponse.toString();\n\n IdResponse<Long> nullIdResponse = new IdResponse<Long>(null);\n nullIdResponse.toString();\n }",
"class_method_signature": "TestIdResponse.testToString()",
... | {
"fields": [
{
"declarator": "_key",
"modifier": "private",
"original_string": "private K _key;",
"type": "K",
"var_name": "_key"
}
],
"file": "restli-common/src/main/java/com/linkedin/restli/common/IdResponse.java",
"identifier": "IdResponse",
"interfaces": "",
"metho... | {
"body": "@Override\n public String toString()\n {\n return (this._key == null)? \"\" : this._key.toString();\n }",
"class_method_signature": "IdResponse.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"invocations": [
"toString... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_243 | {
"fields": [
{
"declarator": "FS = File.separator",
"modifier": "private static final",
"original_string": "private static final String FS = File.separator;",
"type": "String",
"var_name": "FS"
},
{
"declarator": "IDLS_DIR = \"src\" + FS + \"test\" + FS + \"resources\"... | {
"body": "@Test\n public void testSimpleResource() throws Exception\n {\n String idl = moduleDir + FS + IDLS_DIR + FS + \"testSimple.restspec.json\";\n Set<BuilderSpec> builderSpecs = generateBuilderSpec(new String[] {idl});\n Assert.assertNotNull(builderSpecs);\n Assert.assertTrue(builderSpecs.size() ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(RequestBuilderSpecGenerator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(RequestBuilderSpecGenerator.class);",
"type": "Logger",
"var_name": "log... | {
"body": "private static String getResourcePath(String rawPath)\n {\n if (rawPath.charAt(0) == '/')\n {\n return rawPath.substring(1);\n }\n return rawPath;\n }",
"class_method_signature": "RequestBuilderSpecGenerator.getResourcePath(String rawPath)",
"constructor": false,
"full_signature": ... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_306 | {
"fields": [],
"file": "r2-core/src/test/java/com/linkedin/r2/util/TestLinkedDeque.java",
"identifier": "TestLinkedDeque",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEmptyPeekLast()\n {\n LinkedDeque<Object> q = new LinkedDeque<Object>();\n Assert.assertNull(q.peekLast(), \"peekLast on empty queue should return null\");\n }",
"class_method_signature": "TestLinkedDeque.testEmptyPeekLast()",
"constructor": false,
"full_signature": "... | {
"fields": [
{
"declarator": "_head",
"modifier": "private",
"original_string": "private Node<T> _head;",
"type": "Node<T>",
"var_name": "_head"
},
{
"declarator": "_tail",
"modifier": "private",
"original_string": "private Node<T> _tail;",
"type": "N... | {
"body": "@Override\n public T peekLast()\n {\n if (_tail == null)\n {\n return null;\n }\n return _tail._value;\n }",
"class_method_signature": "LinkedDeque.peekLast()",
"constructor": false,
"full_signature": "@Override public T peekLast()",
"identifier": "peekLast",
"invocations": []... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
6944525_469 | {
"fields": [
{
"declarator": "JSON_TYPE = \"application/json\"",
"modifier": "private static final",
"original_string": "private static final String JSON_TYPE = \"application/json\";",
"type": "String",
"var_name": "JSON_TYPE"
},
{
"declarator": "PSON_TYPE = \"applicat... | {
"body": "@Test\n public void testArrayTrim() throws CloneNotSupportedException\n {\n TyperefTest test = new TyperefTest();\n RecordBarArray array = new RecordBarArray();\n\n RecordBar recordBar = new RecordBar();\n recordBar.setLocation(\"mountain view\");\n array.add(recordBar);\n\n RecordBar r... | {
"fields": [
{
"declarator": "EMPTY_DATAMAP = new DataMap()",
"modifier": "private static final",
"original_string": "private static final DataMap EMPTY_DATAMAP = new DataMap();",
"type": "DataMap",
"var_name": "EMPTY_DATAMAP"
}
],
"file": "restli-server/src/main/java/com/li... | {
"body": "public static void trimRecordTemplate(RecordTemplate recordTemplate, MaskTree override, final boolean failOnMismatch)\n {\n trimRecordTemplate(recordTemplate.data(), recordTemplate.schema(), override, failOnMismatch);\n }",
"class_method_signature": "RestUtils.trimRecordTemplate(RecordTemplate recor... | {
"created": "11/30/2012 7:37:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 6944525,
"size": null,
"stargazer_count": null,
"stars": 2005,
"updates": "2020-01-26T06:06:48+00:00",
"url": "https://github.com/linkedin/rest.l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.