id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
104141068_286 | {
"fields": [
{
"declarator": "emf",
"modifier": "private",
"original_string": "private MinijaxEntityManagerFactory emf;",
"type": "MinijaxEntityManagerFactory",
"var_name": "emf"
},
{
"declarator": "em",
"modifier": "private",
"original_string": "private Mi... | {
"body": "@Test(expected = UnsupportedOperationException.class)\n public void testMod3() {\n cb.mod((Integer) null, (Expression<Integer>) null);\n }",
"class_method_signature": "MinijaxCriteriaBuilderTest.testMod3()",
"constructor": false,
"full_signature": "@Test(expected = UnsupportedOperationEx... | {
"fields": [
{
"declarator": "metamodel",
"modifier": "private final",
"original_string": "private final MinijaxMetamodel metamodel;",
"type": "MinijaxMetamodel",
"var_name": "metamodel"
}
],
"file": "minijax-components/minijax-persistence/src/main/java/org/minijax/persisten... | {
"body": "@Override\n public Expression<Integer> mod(final Expression<Integer> x, final Expression<Integer> y) {\n throw new UnsupportedOperationException();\n }",
"class_method_signature": "MinijaxCriteriaBuilder.mod(final Expression<Integer> x, final Expression<Integer> y)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_1 | {
"fields": [],
"file": "minijax-examples/minijax-example-servlet/src/test/java/com/example/HelloResourceTest.java",
"identifier": "HelloResourceTest",
"interfaces": "",
"superclass": "extends MinijaxTest"
} | {
"body": "@Test\n public void testHello() {\n assertEquals(\"Hello world!\", target(\"/\").request().get(String.class));\n }",
"class_method_signature": "HelloResourceTest.testHello()",
"constructor": false,
"full_signature": "@Test public void testHello()",
"identifier": "testHello",
"invocat... | {
"fields": [],
"file": "minijax-examples/minijax-example-servlet/src/main/java/com/example/HelloResource.java",
"identifier": "HelloResource",
"interfaces": "",
"methods": [
{
"class_method_signature": "HelloResource.hello()",
"constructor": false,
"full_signature": "@GET public String ... | {
"body": "@GET\n public String hello() {\n return \"Hello world!\";\n }",
"class_method_signature": "HelloResource.hello()",
"constructor": false,
"full_signature": "@GET public String hello()",
"identifier": "hello",
"invocations": [],
"modifiers": "@GET public",
"parameters": "()",
"re... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_140 | {
"fields": [
{
"declarator": "emf",
"modifier": "private",
"original_string": "private MinijaxEntityManagerFactory emf;",
"type": "MinijaxEntityManagerFactory",
"var_name": "emf"
},
{
"declarator": "em",
"modifier": "private",
"original_string": "private Mi... | {
"body": "@Test(expected = UnsupportedOperationException.class)\n public void testFind1() {\n em.find(Widget.class, \"123\", properties);\n }",
"class_method_signature": "MinijaxEntityManagerTest.testFind1()",
"constructor": false,
"full_signature": "@Test(expected = UnsupportedOperationException.... | {
"fields": [
{
"declarator": "emf",
"modifier": "private final",
"original_string": "private final MinijaxEntityManagerFactory emf;",
"type": "MinijaxEntityManagerFactory",
"var_name": "emf"
},
{
"declarator": "metamodel",
"modifier": "private final",
"orig... | {
"body": "@Override\n public <T> T find(final Class<T> entityClass, final Object primaryKey) {\n final MinijaxCriteriaBuilder cb = getCriteriaBuilder();\n final MinijaxCriteriaQuery<T> q = cb.createQuery(entityClass);\n final MinijaxRoot<T> w = q.from(entityClass);\n q.select(w).where(... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_74 | {
"fields": [],
"file": "minijax-components/minijax-commons/src/test/java/org/minijax/commons/CopyOnWriteMapTest.java",
"identifier": "CopyOnWriteMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemove() {\n final CopyOnWriteMap<String, String> map = new CopyOnWriteMap<>();\n map.put(\"a\", \"b\");\n map.remove(\"a\");\n assertNull(map.get(\"a\"));\n }",
"class_method_signature": "CopyOnWriteMapTest.testRemove()",
"constructor": false,
... | {
"fields": [
{
"declarator": "delegate = Collections.emptyMap()",
"modifier": "private",
"original_string": "private Map<K, V> delegate = Collections.emptyMap();",
"type": "Map<K, V>",
"var_name": "delegate"
}
],
"file": "minijax-components/minijax-commons/src/main/java/org/... | {
"body": "@Override\n public synchronized boolean remove(final Object key, final Object value) {\n final Map<K, V> oldDelegate = this.delegate;\n final V existing = oldDelegate.get(key);\n if (existing.equals(value)) {\n removeInternal(key);\n return true;\n }\n ... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_394 | {
"fields": [
{
"declarator": "validator",
"modifier": "private static",
"original_string": "private static Validator validator;",
"type": "Validator",
"var_name": "validator"
}
],
"file": "minijax-components/minijax-security/src/test/java/org/minijax/security/UserSessionTest... | {
"body": "@Test\n public void testValidate() {\n final UserSession s = new UserSession();\n s.setUser(new User());\n assertTrue(validator.validate(s).isEmpty());\n }",
"class_method_signature": "UserSessionTest.testValidate()",
"constructor": false,
"full_signature": "@Test public vo... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "userId",
"modifier": "@Column(colum... | {
"body": "public void setUser(final SecurityUser user) {\n userId = user.getId();\n this.user = user;\n }",
"class_method_signature": "UserSession.setUser(final SecurityUser user)",
"constructor": false,
"full_signature": "public void setUser(final SecurityUser user)",
"identifier": "setUser... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_402 | {
"fields": [
{
"declarator": "context",
"modifier": "private",
"original_string": "private MinijaxRequestContext context;",
"type": "MinijaxRequestContext",
"var_name": "context"
}
],
"file": "minijax-components/minijax-security/src/test/java/org/minijax/security/SecurityTes... | {
"body": "@Test\n public void testLoginIncorrectPassword() {\n final User user = new User();\n user.setPassword(\"testtest\");\n\n final SecurityDao dao = mock(SecurityDao.class);\n when(dao.findUserByEmail(eq(User.class), eq(\"user@example.com\"))).thenReturn(user);\n\n final C... | {
"fields": [
{
"declarator": "MINIMUM_PASSWORD_LENGTH = 8",
"modifier": "public static final",
"original_string": "public static final int MINIMUM_PASSWORD_LENGTH = 8;",
"type": "int",
"var_name": "MINIMUM_PASSWORD_LENGTH"
},
{
"declarator": "COOKIE_NAME = \"a\"",
... | {
"body": "public LoginResult login(final String email, final String password) {\n final SecurityUser candidate = dao.findUserByEmail(userClass, email);\n if (candidate == null) {\n return LoginResult.NOT_FOUND;\n }\n\n if (candidate.getPasswordHash() == null) {\n ret... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
104141068_117 | {
"fields": [],
"file": "minijax-components/minijax-persistence/src/test/java/org/minijax/persistence/jpql/TokenizerTest.java",
"identifier": "TokenizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSelectByVariable() {\n final List<Token> tokens = Tokenizer.tokenize(\"SELECT w FROM Widget w WHERE id = :id\");\n assertNotNull(tokens);\n assertEquals(9, tokens.size());\n\n final List<Token> expected = Arrays.asList(\n new Token(Token... | {
"fields": [
{
"declarator": "KEYWORDS",
"modifier": "private static final",
"original_string": "private static final Map<String, TokenType> KEYWORDS;",
"type": "Map<String, TokenType>",
"var_name": "KEYWORDS"
},
{
"declarator": "result",
"modifier": "private fin... | {
"body": "public static List<Token> tokenize(final String str) {\n return new Tokenizer(str).tokenize();\n }",
"class_method_signature": "Tokenizer.tokenize(final String str)",
"constructor": false,
"full_signature": "public static List<Token> tokenize(final String str)",
"identifier": "tokenize",
... | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 104141068,
"size": 2657,
"stargazer_count": 16,
"stars": null,
"updates": null,
"url": "https://github.com/minijax/minijax"
} |
1603876_4 | {
"fields": [],
"file": "core/src/test/java/org/featureflags/FlagManagerTest.java",
"identifier": "FlagManagerTest",
"interfaces": "",
"superclass": "extends FeatureFlagTest"
} | {
"body": "@Test\n public void testFlipFlagForUser() {\n\n\tString[] testUsers = new String[] { \"bob\", \"john\", \"foo\", \"bar\", \"bob2\", \"john2\", \"foo2\", \"bar2\" };\n\tString[] flagState = new String[] { \"UP\", \"UP\", \"DOWN\", \"UP\", \"UP\", \"UP\", \"DOWN\", \"UP\" };\n\tFlagThread[] flagThreads = ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(this.getClass())",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "instance",
"modifier... | {
"body": "public Result flipFlagForUser(String userName, String flagName) {\n\tsetThreadUserName(userName);\n\tMap<FeatureFlags, FlagState> userFlagsState = getOrCreateUser(userName);\n\tFeatureFlags flag = getFlag(flagName);\n\tFlagState newFlagState = flag.isUp() ? FlagState.DOWN : FlagState.UP;\n\tresetThreadUser... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 1603876,
"size": 132,
"stargazer_count": 20,
"stars": null,
"updates": null,
"url": "https://github.com/toutantic/featureflags"
} |
1603876_2 | {
"fields": [],
"file": "core/src/test/java/org/featureflags/FlagManagerTest.java",
"identifier": "FlagManagerTest",
"interfaces": "",
"superclass": "extends FeatureFlagTest"
} | {
"body": "@Test\n public void testGetFlag() {\n\n\tFeatureFlags flag = manager.getFlag(\"ONE\");\n\tassertEquals(\"get flag ONE\", Flags.ONE, flag);\n\tflag = manager.getFlag(\"THREE\");\n\tassertEquals(\"get flag THREE\", Flags.THREE, flag);\n\tflag = manager.getFlag(\"YOU SHALL NOT EXIST\");\n\tassertEquals(\"g... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(this.getClass())",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "instance",
"modifier... | {
"body": "public FeatureFlags getFlag(String flagName) {\n\treturn (FeatureFlags) invokeStaticMethod(\"valueOf\", new Object[] { flagName }, String.class);\n }",
"class_method_signature": "FlagManager.getFlag(String flagName)",
"constructor": false,
"full_signature": "public FeatureFlags getFlag(String flag... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 1603876,
"size": 132,
"stargazer_count": 20,
"stars": null,
"updates": null,
"url": "https://github.com/toutantic/featureflags"
} |
1603876_3 | {
"fields": [],
"file": "core/src/test/java/org/featureflags/FlagManagerTest.java",
"identifier": "FlagManagerTest",
"interfaces": "",
"superclass": "extends FeatureFlagTest"
} | {
"body": "@Test\n public void testFlipFlag() {\n\tflipFlag(\"ONE\");\n\tflipFlag(\"TWO\");\n\tflipFlag(\"THREE\");\n }",
"class_method_signature": "FlagManagerTest.testFlipFlag()",
"constructor": false,
"full_signature": "@Test public void testFlipFlag()",
"identifier": "testFlipFlag",
"invocations":... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(this.getClass())",
"modifier": "private",
"original_string": "private Logger log = LoggerFactory.getLogger(this.getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "instance",
"modifier... | {
"body": "public Result flipFlag(String flagName) {\n\tFeatureFlags flag = getFlag(flagName);\n\tif (flag == null) {\n\t return Result.NOT_FOUND;\n\t}\n\treturn flipFlag(flag);\n }",
"class_method_signature": "FlagManager.flipFlag(String flagName)",
"constructor": false,
"full_signature": "public Result ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 1603876,
"size": 132,
"stargazer_count": 20,
"stars": null,
"updates": null,
"url": "https://github.com/toutantic/featureflags"
} |
1603876_0 | {
"fields": [
{
"declarator": "template",
"modifier": "private",
"original_string": "private StringTemplate template;",
"type": "StringTemplate",
"var_name": "template"
}
],
"file": "core/src/test/java/org/featureflags/StringTemplateTest.java",
"identifier": "StringTemplate... | {
"body": "@Test\n public void testNoUser() {\n\tString actual = template.getHtmlForFlag(Flags.ONE, null);\n\tString expected = Utils.readRessource(this, \"/expectedNoUser.html\");\n\n\tassertEquals(\"NoUser\", expected, actual);\n }",
"class_method_signature": "StringTemplateTest.testNoUser()",
"constructo... | {
"fields": [
{
"declarator": "htmlTemplate",
"modifier": "private",
"original_string": "private String htmlTemplate;",
"type": "String",
"var_name": "htmlTemplate"
},
{
"declarator": "linkTemplate",
"modifier": "private",
"original_string": "private String ... | {
"body": "public String getHtmlForFlag(FeatureFlags flag, String userName) {\n\tStringBuilder content = new StringBuilder();\n\tif(userName == null) {\n\t content.append(getHtmlForUserFlag(flag, userName,null));\n\t}\n\tString[] userNames = flagManager.getUsersForFlag(flag);\n\tif (userNames.length > 0) {\n\t ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 1603876,
"size": 132,
"stargazer_count": 20,
"stars": null,
"updates": null,
"url": "https://github.com/toutantic/featureflags"
} |
1603876_1 | {
"fields": [
{
"declarator": "template",
"modifier": "private",
"original_string": "private StringTemplate template;",
"type": "StringTemplate",
"var_name": "template"
}
],
"file": "core/src/test/java/org/featureflags/StringTemplateTest.java",
"identifier": "StringTemplate... | {
"body": "@Test\n public void testUserBob() {\n\t\n\tString actual = template.getHtmlForFlag(Flags.ONE, \"bob\");\n\tString expected = Utils.readRessource(this, \"/expectedUserDoesNotExist.html\");\n\tassertEquals(\"UserDoesNotExist\", expected, actual);\n\tmanager.flipFlagForUser(\"bob\", Flags.ONE.name());\n\ta... | {
"fields": [
{
"declarator": "htmlTemplate",
"modifier": "private",
"original_string": "private String htmlTemplate;",
"type": "String",
"var_name": "htmlTemplate"
},
{
"declarator": "linkTemplate",
"modifier": "private",
"original_string": "private String ... | {
"body": "public String getHtmlForFlag(FeatureFlags flag, String userName) {\n\tStringBuilder content = new StringBuilder();\n\tif(userName == null) {\n\t content.append(getHtmlForUserFlag(flag, userName,null));\n\t}\n\tString[] userNames = flagManager.getUsersForFlag(flag);\n\tif (userNames.length > 0) {\n\t ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 1603876,
"size": 132,
"stargazer_count": 20,
"stars": null,
"updates": null,
"url": "https://github.com/toutantic/featureflags"
} |
21942754_1 | {
"fields": [
{
"declarator": "log = LogFactory.getLog(getClass())",
"modifier": "private final",
"original_string": "private final Log log = LogFactory.getLog(getClass());",
"type": "Log",
"var_name": "log"
},
{
"declarator": "cloudFoundryDiscoveryClient",
"modif... | {
"body": "@Test\n\tpublic void testInstances() {\n\t\tApplicationDetail applicationDetail = ApplicationDetail.builder().instances(2).name(\"my-app\").stack(\"stack\")\n\t\t\t\t.memoryLimit(1024).id(\"id\").requestedState(\"requestedState\").runningInstances(2)\n\t\t\t\t.url(\"http://my-app-cfapps-io\").diskQuota(20)... | {
"fields": [
{
"declarator": "cloudFoundryService",
"modifier": "private final",
"original_string": "private final CloudFoundryService cloudFoundryService;",
"type": "CloudFoundryService",
"var_name": "cloudFoundryService"
},
{
"declarator": "cloudFoundryOperations",
... | {
"body": "@Override\n\tpublic List<ServiceInstance> getInstances(String serviceId) {\n\t\treturn this.cloudFoundryService.getApplicationInstances(serviceId).map(tuple -> {\n\t\t\tApplicationDetail applicationDetail = tuple.getT1();\n\t\t\tInstanceDetail instanceDetail = tuple.getT2();\n\n\t\t\tString applicationId =... | {
"created": null,
"fork": null,
"fork_count": 62,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21942754,
"size": 117096,
"stargazer_count": 77,
"stars": null,
"updates": null,
"url": "https://github.com/spring-cloud/spring-cloud-cloudfoundry"
} |
21942754_0 | {
"fields": [
{
"declarator": "log = LogFactory.getLog(getClass())",
"modifier": "private final",
"original_string": "private final Log log = LogFactory.getLog(getClass());",
"type": "Log",
"var_name": "log"
},
{
"declarator": "cloudFoundryDiscoveryClient",
"modif... | {
"body": "@Test\n\tpublic void testServiceResolution() {\n\t\tApplications apps = mock(Applications.class);\n\t\tApplicationSummary s = ApplicationSummary.builder().id(UUID.randomUUID().toString()).instances(2)\n\t\t\t\t.memoryLimit(1024).requestedState(\"requestedState\").diskQuota(1024).name(this.hiServiceServiceI... | {
"fields": [
{
"declarator": "cloudFoundryService",
"modifier": "private final",
"original_string": "private final CloudFoundryService cloudFoundryService;",
"type": "CloudFoundryService",
"var_name": "cloudFoundryService"
},
{
"declarator": "cloudFoundryOperations",
... | {
"body": "@Override\n\tpublic List<String> getServices() {\n\t\treturn this.cloudFoundryOperations.applications().list().map(ApplicationSummary::getName).collectList()\n\t\t\t\t.blockOptional().orElse(new ArrayList<>());\n\t}",
"class_method_signature": "CloudFoundryDiscoveryClient.getServices()",
"constructor":... | {
"created": null,
"fork": null,
"fork_count": 62,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21942754,
"size": 117096,
"stargazer_count": 77,
"stars": null,
"updates": null,
"url": "https://github.com/spring-cloud/spring-cloud-cloudfoundry"
} |
21942754_3 | {
"fields": [
{
"declarator": "discoveryClient",
"modifier": "private",
"original_string": "private CloudFoundryAppServiceDiscoveryClient discoveryClient;",
"type": "CloudFoundryAppServiceDiscoveryClient",
"var_name": "discoveryClient"
},
{
"declarator": "cloudFoundryOp... | {
"body": "@Test\n\tpublic void getInstancesThreeInstance() {\n\t\tString serviceId = \"billing\";\n\t\tApplicationDetail applicationDetail = ApplicationDetail.builder().id(\"billing-id\").name(\"billing\").instances(3)\n\t\t\t\t.memoryLimit(1024).stack(\"cflinux2\").diskQuota(1024).requestedState(\"Running\").runnin... | {
"fields": [
{
"declarator": "INTERNAL_DOMAIN = \"apps.internal\"",
"modifier": "private static final",
"original_string": "private static final String INTERNAL_DOMAIN = \"apps.internal\";",
"type": "String",
"var_name": "INTERNAL_DOMAIN"
}
],
"file": "spring-cloud-cloudfoun... | {
"body": "@Override\n\tpublic List<ServiceInstance> getInstances(String serviceId) {\n\t\treturn getCloudFoundryService().getApplicationInstances(serviceId)\n\t\t\t\t.filter(tuple -> tuple.getT1().getUrls().stream().anyMatch(this::isInternalDomain)).map(tuple -> {\n\t\t\t\t\tApplicationDetail applicationDetail = tup... | {
"created": null,
"fork": null,
"fork_count": 62,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21942754,
"size": 117096,
"stargazer_count": 77,
"stars": null,
"updates": null,
"url": "https://github.com/spring-cloud/spring-cloud-cloudfoundry"
} |
21942754_2 | {
"fields": [
{
"declarator": "discoveryClient",
"modifier": "private",
"original_string": "private CloudFoundryAppServiceDiscoveryClient discoveryClient;",
"type": "CloudFoundryAppServiceDiscoveryClient",
"var_name": "discoveryClient"
},
{
"declarator": "cloudFoundryOp... | {
"body": "@Test\n\tpublic void getInstancesOneInstance() {\n\t\tString serviceId = \"billing\";\n\t\tApplicationDetail applicationDetail = ApplicationDetail.builder().id(\"billing1\").name(\"billing\").instances(1)\n\t\t\t\t.memoryLimit(1024).stack(\"cflinux2\").diskQuota(1024).requestedState(\"Running\").runningIns... | {
"fields": [
{
"declarator": "INTERNAL_DOMAIN = \"apps.internal\"",
"modifier": "private static final",
"original_string": "private static final String INTERNAL_DOMAIN = \"apps.internal\";",
"type": "String",
"var_name": "INTERNAL_DOMAIN"
}
],
"file": "spring-cloud-cloudfoun... | {
"body": "@Override\n\tpublic List<ServiceInstance> getInstances(String serviceId) {\n\t\treturn getCloudFoundryService().getApplicationInstances(serviceId)\n\t\t\t\t.filter(tuple -> tuple.getT1().getUrls().stream().anyMatch(this::isInternalDomain)).map(tuple -> {\n\t\t\t\t\tApplicationDetail applicationDetail = tup... | {
"created": null,
"fork": null,
"fork_count": 62,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21942754,
"size": 117096,
"stargazer_count": 77,
"stars": null,
"updates": null,
"url": "https://github.com/spring-cloud/spring-cloud-cloudfoundry"
} |
21942754_4 | {
"fields": [
{
"declarator": "discoveryClient",
"modifier": "private",
"original_string": "private CloudFoundryAppServiceDiscoveryClient discoveryClient;",
"type": "CloudFoundryAppServiceDiscoveryClient",
"var_name": "discoveryClient"
},
{
"declarator": "cloudFoundryOp... | {
"body": "@Test\n\tpublic void getInstancesEmpty() {\n\t\tString serviceId = \"billing\";\n\t\tApplicationDetail applicationDetail = ApplicationDetail.builder().id(\"billing1\").name(\"billing\").instances(1)\n\t\t\t\t.memoryLimit(1024).stack(\"cflinux2\").diskQuota(1024).requestedState(\"Running\").runningInstances... | {
"fields": [
{
"declarator": "INTERNAL_DOMAIN = \"apps.internal\"",
"modifier": "private static final",
"original_string": "private static final String INTERNAL_DOMAIN = \"apps.internal\";",
"type": "String",
"var_name": "INTERNAL_DOMAIN"
}
],
"file": "spring-cloud-cloudfoun... | {
"body": "@Override\n\tpublic List<ServiceInstance> getInstances(String serviceId) {\n\t\treturn getCloudFoundryService().getApplicationInstances(serviceId)\n\t\t\t\t.filter(tuple -> tuple.getT1().getUrls().stream().anyMatch(this::isInternalDomain)).map(tuple -> {\n\t\t\t\t\tApplicationDetail applicationDetail = tup... | {
"created": null,
"fork": null,
"fork_count": 62,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21942754,
"size": 117096,
"stargazer_count": 77,
"stars": null,
"updates": null,
"url": "https://github.com/spring-cloud/spring-cloud-cloudfoundry"
} |
189734293_0 | {
"fields": [],
"file": "lib/src/test/java/cn/hikyson/methodcanary/lib/MethodEventTest.java",
"identifier": "MethodEventTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToString() {\n Log4Test.d(MethodEventHelper.createRandomMethodEvent().toString());\n }",
"class_method_signature": "MethodEventTest.testToString()",
"constructor": false,
"full_signature": "@Test public void testToString()",
"identifier": "testToString",
"invo... | {
"fields": [
{
"declarator": "className",
"modifier": "public",
"original_string": "public String className;",
"type": "String",
"var_name": "className"
},
{
"declarator": "methodAccessFlag",
"modifier": "public",
"original_string": "public int methodAccess... | {
"body": "@Override\n public String toString() {\n return \"MethodEvent{\" +\n \"className='\" + className + '\\'' +\n \", methodAccessFlag=\" + methodAccessFlag +\n \", methodName='\" + methodName + '\\'' +\n \", methodDesc='\" + methodDesc + '\\... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 189734293,
"size": 1224,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/Kyson/MethodCanary"
} |
55332995_1 | {
"fields": [
{
"declarator": "res = new PhoneRecordAPIResource()",
"modifier": "private",
"original_string": "private PhoneRecordAPIResource res = new PhoneRecordAPIResource();",
"type": "PhoneRecordAPIResource",
"var_name": "res"
}
],
"file": "samples/mfp-api-twilio-sql-spr... | {
"body": "@Test\n public void testEmptyParams() {\n\n try {\n res.registerPhone(\"\", \"12345678\");\n fail(\"Should throw an exception\");\n } catch(Exception e) {\n e.printStackTrace();\n }\n }",
"class_method_signature": "PhoneRecordAPIResourceTest.tes... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(PhoneRecordAPIResource.class.getName())",
"modifier": "static",
"original_string": "static Logger logger = Logger.getLogger(PhoneRecordAPIResource.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"d... | {
"body": "@POST\n @Path(\"register/{user}/{phoneNumber}\")\n @Produces(MediaType.APPLICATION_JSON)\n @OAuthSecurity(enabled = true)\n @ApiOperation(value = \"Start user-phone bind process\",\n notes = \"Saves the user's data in a database and than send an SMS message with a code for a user to ... | {
"created": null,
"fork": null,
"fork_count": 18,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 55332995,
"size": 87360,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/mfpdev/mfp-advanced-adapters-samples"
} |
55332995_0 | {
"fields": [],
"file": "samples/mfp-api-twilio-sql-spring-sample/src/test/java/com/github/mfpdev/twilio/sample/phoneuser/TwilioAccessTest.java",
"identifier": "TwilioAccessTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFailCall() {\n\n System.out.println(\"testFailCall\");\n TwilioAccess t = new TwilioAccess(\"1234567890\", \"1234567890\", \"1234567890\");\n assertFalse(t.send(\"1234567890\", \"This is the body\"));\n }",
"class_method_signature": "TwilioAccessTest.tes... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(TwilioAccess.class.getName())",
"modifier": "static",
"original_string": "static Logger logger = Logger.getLogger(TwilioAccess.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "twilioS... | {
"body": "public boolean send(final String to, final String body) {\n // Build a filter for the MessageList\n final List<NameValuePair> params = new ArrayList<>();\n params.add(new BasicNameValuePair(\"Body\", body));\n params.add(new BasicNameValuePair(\"To\", to));\n params.add(n... | {
"created": null,
"fork": null,
"fork_count": 18,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 55332995,
"size": 87360,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/mfpdev/mfp-advanced-adapters-samples"
} |
55332995_2 | {
"fields": [],
"file": "samples/mfp-api-twilio-sql-spring-sample/src/test/java/com/github/mfpdev/twilio/sample/phoneuser/DataAccessTest.java",
"identifier": "DataAccessTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoSuchRow() {\n\n DataAccess d = new DataAccess(getTemplate());\n\n RegistrationRecord r = d.fetchByUserName(\"no such user\", false);\n\n assertNull(r);\n }",
"class_method_signature": "DataAccessTest.testNoSuchRow()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(DataAccess.class.getName())",
"modifier": "static",
"original_string": "static Logger logger = Logger.getLogger(DataAccess.class.getName());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "dataAccess"... | {
"body": "public RegistrationRecord fetchByUserName(String name, final boolean onlyValidated) {\n\n name = name == null ? \"\" : name.trim();\n\n if(name.isEmpty()) {\n logger.severe(String.format(\"Fetching by name, but empty name [%s]\", name));\n throw new IllegalArgumentExcept... | {
"created": null,
"fork": null,
"fork_count": 18,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 55332995,
"size": 87360,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/mfpdev/mfp-advanced-adapters-samples"
} |
21477166_3 | {
"fields": [],
"file": "kumo-cli/src/test/java/com/kennycason/kumo/cli/ParenthesisSerializerTest.java",
"identifier": "ParenthesisSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void deserialize() {\n assertTrue(ParenthesisSerializer.deserialize(\"\").isEmpty());\n assertEquals(1, ParenthesisSerializer.deserialize(\"(a)\").size());\n assertEquals(\"a\", ParenthesisSerializer.deserialize(\"(a)\").get(0));\n\n assertEquals(2, Parenthesis... | {
"fields": [
{
"declarator": "PARENTHESIS_SPLIT_REGEX = Pattern.compile(\"\\\\)[ | ]*,[ | ]*\\\\(\")",
"modifier": "private static final",
"original_string": "private static final Pattern PARENTHESIS_SPLIT_REGEX = Pattern.compile(\"\\\\)[ | ]*,[ | ]*\\\\(\");",
"type": "Pattern",
"v... | {
"body": "public static List<String> deserialize(final String value) {\n if (isBlank(value)) { return Collections.emptyList(); }\n\n final String normalizedValue = trimToEmpty(value);\n if (normalizedValue.startsWith(\"(\") && normalizedValue.endsWith(\")\")) {\n return Arrays.asList(... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_14 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/font/scale/LinearFontScalarTest.java",
"identifier": "LinearFontScalarTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testScale() {\n final LinearFontScalar fontScalar = new LinearFontScalar(-1, 13);\n Assert.assertEquals(5.0f, fontScalar.scale(4, 1, 8), 0.0f);\n\n final LinearFontScalar fontScalar2 = new LinearFontScalar(0, 0);\n Assert.assertEquals(Float.NaN, fontScalar... | {
"fields": [
{
"declarator": "minFont",
"modifier": "private final",
"original_string": "private final int minFont;",
"type": "int",
"var_name": "minFont"
},
{
"declarator": "maxFont",
"modifier": "private final",
"original_string": "private final int maxFo... | {
"body": "@Override\n public float scale(final int value, final int minValue, final int maxValue) {\n final float leftSpan = maxValue - minValue;\n final float rightSpan = maxFont - minFont;\n\n // Convert the left range into a 0-1 range\n final float valueScaled = (value - minValue) /... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_15 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/font/scale/LogFontScalarTest.java",
"identifier": "LogFontScalarTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testScale() {\n final LogFontScalar fontScalar = new LogFontScalar(-1, 13);\n Assert.assertEquals(8.333333f, fontScalar.scale(4, 1, 8), 0.0f);\n\n final LogFontScalar fontScalar2 = new LogFontScalar(0, 0);\n Assert.assertEquals(Float.NaN, fontScalar2.scale... | {
"fields": [
{
"declarator": "minFont",
"modifier": "private final",
"original_string": "private final int minFont;",
"type": "int",
"var_name": "minFont"
},
{
"declarator": "maxFont",
"modifier": "private final",
"original_string": "private final int maxFo... | {
"body": "@Override\n public float scale(final int value, final int minValue, final int maxValue) {\n final double leftSpan = Math.log(maxValue) - Math.log(minValue);\n final double rightSpan = maxFont - minFont;\n\n // Convert the left range into a 0-1 range\n final double valueScaled... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_2 | {
"fields": [],
"file": "kumo-cli/src/test/java/com/kennycason/kumo/cli/ParenthesisSerializerTest.java",
"identifier": "ParenthesisSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serialize() {\n assertEquals(\"\", ParenthesisSerializer.serialize(Collections.emptyList()));\n assertEquals(\"(a)\", ParenthesisSerializer.serialize(Arrays.asList(\"a\")));\n assertEquals(\"(a),(b),(c)\", ParenthesisSerializer.serialize(Arrays.asList(\"a\", \"b\... | {
"fields": [
{
"declarator": "PARENTHESIS_SPLIT_REGEX = Pattern.compile(\"\\\\)[ | ]*,[ | ]*\\\\(\")",
"modifier": "private static final",
"original_string": "private static final Pattern PARENTHESIS_SPLIT_REGEX = Pattern.compile(\"\\\\)[ | ]*,[ | ]*\\\\(\");",
"type": "Pattern",
"v... | {
"body": "public static <T> String serialize(final Collection<T> collection) {\n if (collection.isEmpty()) { return \"\"; }\n\n final String joined = collection.stream()\n .map(Object::toString)\n .collect(Collectors.joining(... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_9 | {
"fields": [
{
"declarator": "FREQUENCY_FILE_LOADER = new FrequencyFileLoader()",
"modifier": "private static final",
"original_string": "private static final FrequencyFileLoader FREQUENCY_FILE_LOADER = new FrequencyFileLoader();",
"type": "FrequencyFileLoader",
"var_name": "FREQUEN... | {
"body": "@Test(expected = KumoException.class)\n public void malformedWord() throws IOException {\n FREQUENCY_FILE_LOADER.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"frequency_file_malformed_word.txt\"));\n }",
"class_method_signature": "FrequencyFileLoaderTest.malformed... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_ERROR_MESSAGE = \... | {
"body": "public List<WordFrequency> load(final File file) throws IOException {\n return load(new FileInputStream(file));\n }",
"class_method_signature": "FrequencyFileLoader.load(final File file)",
"constructor": false,
"full_signature": "public List<WordFrequency> load(final File file)",
"identif... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_5 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/image/CollisionRasterTest.java",
"identifier": "CollisionRasterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void illegalY() {\n final Dimension dimension = new Dimension(90, 60);\n final CollisionRaster collisionRaster = new CollisionRaster(dimension);\n collisionRaster.setPixelIsNotTransparent(0, 70);\n }",
"class_method_sign... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final BitSet data;",
"type": "BitSet",
"var_name": "data"
},
{
"declarator": "dimension",
"modifier": "private final",
"original_string": "private final Dimension ... | {
"body": "public final void setPixelIsNotTransparent(final int x, final int y) {\n data.set(computeIndex(x, y));\n }",
"class_method_signature": "CollisionRaster.setPixelIsNotTransparent(final int x, final int y)",
"constructor": false,
"full_signature": "public final void setPixelIsNotTransparent(fi... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_12 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/nlp/FrequencyAnalyzerTest.java",
"identifier": "FrequencyAnalyzerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void largeTextFileTest() throws IOException {\n final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer();\n final List<WordFrequency> wordFrequencies = frequencyAnalyzer.load(\n Thread.currentThread().getContextClassLoader().getResourceAsStream(\"te... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_WORD_MAX_LENGTH =... | {
"body": "public List<WordFrequency> load(final InputStream inputStream) throws IOException {\n return load(IOUtils.readLines(inputStream, characterEncoding));\n }",
"class_method_signature": "FrequencyAnalyzer.load(final InputStream inputStream)",
"constructor": false,
"full_signature": "public List... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_13 | {
"fields": [
{
"declarator": "WORD_FREQUENCIES = Arrays.asList(new WordFrequency(\"apple\", 22),\n new WordFrequency(\"baby\", 3),\n new WordFrequency(\"ba... | {
"body": "@Test\n public void testWriteToStreamAsPNG() throws IOException {\n final Dimension dimension = new Dimension(200, 200);\n final WordCloud wordCloud = new WordCloud(dimension, CollisionMode.PIXEL_PERFECT);\n wordCloud.build(WORD_FREQUENCIES);\n wordCloud.setPadding(2);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(WordCloud.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(WordCloud.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"decla... | {
"body": "public void writeToStreamAsPNG(final OutputStream outputStream) {\n writeToStream(\"png\", outputStream);\n }",
"class_method_signature": "WordCloud.writeToStreamAsPNG(final OutputStream outputStream)",
"constructor": false,
"full_signature": "public void writeToStreamAsPNG(final OutputStre... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_4 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/image/CollisionRasterTest.java",
"identifier": "CollisionRasterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void illegalX() {\n final Dimension dimension = new Dimension(90, 60);\n final CollisionRaster collisionRaster = new CollisionRaster(dimension);\n collisionRaster.setPixelIsNotTransparent(100, 0);\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final BitSet data;",
"type": "BitSet",
"var_name": "data"
},
{
"declarator": "dimension",
"modifier": "private final",
"original_string": "private final Dimension ... | {
"body": "public final void setPixelIsNotTransparent(final int x, final int y) {\n data.set(computeIndex(x, y));\n }",
"class_method_signature": "CollisionRaster.setPixelIsNotTransparent(final int x, final int y)",
"constructor": false,
"full_signature": "public final void setPixelIsNotTransparent(fi... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_8 | {
"fields": [
{
"declarator": "FREQUENCY_FILE_LOADER = new FrequencyFileLoader()",
"modifier": "private static final",
"original_string": "private static final FrequencyFileLoader FREQUENCY_FILE_LOADER = new FrequencyFileLoader();",
"type": "FrequencyFileLoader",
"var_name": "FREQUEN... | {
"body": "@Test\n public void validFile() throws IOException {\n final List<WordFrequency> wordFrequencies = FREQUENCY_FILE_LOADER.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"frequency_file.txt\"));\n\n assertEquals(4, wordFrequencies.size());\n assertEquals(100,... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_ERROR_MESSAGE = \... | {
"body": "public List<WordFrequency> load(final File file) throws IOException {\n return load(new FileInputStream(file));\n }",
"class_method_signature": "FrequencyFileLoader.load(final File file)",
"constructor": false,
"full_signature": "public List<WordFrequency> load(final File file)",
"identif... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_10 | {
"fields": [
{
"declarator": "FREQUENCY_FILE_LOADER = new FrequencyFileLoader()",
"modifier": "private static final",
"original_string": "private static final FrequencyFileLoader FREQUENCY_FILE_LOADER = new FrequencyFileLoader();",
"type": "FrequencyFileLoader",
"var_name": "FREQUEN... | {
"body": "@Test(expected = KumoException.class)\n public void malformedWordCount() throws IOException {\n FREQUENCY_FILE_LOADER.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(\"frequency_file_malformed_word_count.txt\"));\n }",
"class_method_signature": "FrequencyFileLoaderTes... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_ERROR_MESSAGE = \... | {
"body": "public List<WordFrequency> load(final File file) throws IOException {\n return load(new FileInputStream(file));\n }",
"class_method_signature": "FrequencyFileLoader.load(final File file)",
"constructor": false,
"full_signature": "public List<WordFrequency> load(final File file)",
"identif... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_7 | {
"fields": [
{
"declarator": "FREQUENCY_FILE_LOADER = new FrequencyFileLoader()",
"modifier": "private static final",
"original_string": "private static final FrequencyFileLoader FREQUENCY_FILE_LOADER = new FrequencyFileLoader();",
"type": "FrequencyFileLoader",
"var_name": "FREQUEN... | {
"body": "@Test\n public void basic() throws IOException {\n final List<WordFrequency> wordFrequencies = FREQUENCY_FILE_LOADER.load(IOUtils.toInputStream(\n \"100:cat\\n\" +\n \"50:dog\\n\" +\n \"25:fish\\n\" +\n \"75:frog\"));\n\n assertEq... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_ERROR_MESSAGE = \... | {
"body": "public List<WordFrequency> load(final File file) throws IOException {\n return load(new FileInputStream(file));\n }",
"class_method_signature": "FrequencyFileLoader.load(final File file)",
"constructor": false,
"full_signature": "public List<WordFrequency> load(final File file)",
"identif... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_6 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/image/CollisionRasterTest.java",
"identifier": "CollisionRasterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void collisionsAreFound() {\n CollisionChecker checker = new RectanglePixelCollisionChecker();\n\n final Dimension dimension = new Dimension(90, 60);\n final CollisionRaster collisionRasterA = new CollisionRaster(dimension);\n final CollisionRaster collisionRas... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final BitSet data;",
"type": "BitSet",
"var_name": "data"
},
{
"declarator": "dimension",
"modifier": "private final",
"original_string": "private final Dimension ... | {
"body": "public final void setPixelIsNotTransparent(final int x, final int y) {\n data.set(computeIndex(x, y));\n }",
"class_method_signature": "CollisionRaster.setPixelIsNotTransparent(final int x, final int y)",
"constructor": false,
"full_signature": "public final void setPixelIsNotTransparent(fi... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_11 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/nlp/FrequencyAnalyzerTest.java",
"identifier": "FrequencyAnalyzerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void defaultTokenizerTrim() throws IOException {\n final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer();\n final List<WordFrequency> wordFrequencies = frequencyAnalyzer.load(\n Thread.currentThread().getContextClassLoader().getResourceAsStream(\... | {
"fields": [
{
"declarator": "DEFAULT_ENCODING = \"UTF-8\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_ENCODING = \"UTF-8\";",
"type": "String",
"var_name": "DEFAULT_ENCODING"
},
{
"declarator": "DEFAULT_WORD_MAX_LENGTH =... | {
"body": "public List<WordFrequency> load(final InputStream inputStream) throws IOException {\n return load(IOUtils.readLines(inputStream, characterEncoding));\n }",
"class_method_signature": "FrequencyAnalyzer.load(final InputStream inputStream)",
"constructor": false,
"full_signature": "public List... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_16 | {
"fields": [],
"file": "kumo-core/src/test/java/com/kennycason/kumo/font/scale/SqrtFontScalarTest.java",
"identifier": "SqrtFontScalarTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testScale() {\n final SqrtFontScalar fontScalar = new SqrtFontScalar(-1, 13);\n Assert.assertEquals(6.656854f, fontScalar.scale(4, 1, 8), 0.0f);\n\n final SqrtFontScalar fontScalar2 = new SqrtFontScalar(0, 0);\n Assert.assertEquals(Float.NaN, fontScalar2.s... | {
"fields": [
{
"declarator": "minFont",
"modifier": "private final",
"original_string": "private final int minFont;",
"type": "int",
"var_name": "minFont"
},
{
"declarator": "maxFont",
"modifier": "private final",
"original_string": "private final int maxFo... | {
"body": "@Override\n public float scale(final int value, final int minValue, final int maxValue) {\n final double leftSpan = Math.sqrt(maxValue) - Math.sqrt(minValue);\n final double rightSpan = maxFont - minFont;\n\n // Convert the left range into a 0-1 range\n final double valueScal... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_1 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(EnglishWordTokenizerTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(EnglishWordTokenizerTest.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@Test\n public void test() {\n final long time = System.currentTimeMillis();\n final WordTokenizer tokenizer = new EnglishWordTokenizer();\n LOGGER.info(\"load time: \" + (System.currentTimeMillis() - time) + \" ms\");\n\n assertEquals(Arrays.asList(\"Kenny\"), tokenizer.toke... | {
"fields": [
{
"declarator": "TOKENIZER = new LanguageToolTokenizer(new English())",
"modifier": "private static final",
"original_string": "private static final LanguageToolTokenizer TOKENIZER = new LanguageToolTokenizer(new English());",
"type": "LanguageToolTokenizer",
"var_name"... | {
"body": "@Override\n public List<String> tokenize(final String sentence) {\n return TOKENIZER.tokenize(sentence);\n }",
"class_method_signature": "EnglishWordTokenizer.tokenize(final String sentence)",
"constructor": false,
"full_signature": "@Override public List<String> tokenize(final String se... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
21477166_0 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ChineseWordTokenizerTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ChineseWordTokenizerTest.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "@Test\n public void test() {\n final long time = System.currentTimeMillis();\n final WordTokenizer tokenizer = new ChineseWordTokenizer();\n LOGGER.info(\"load time: \" + (System.currentTimeMillis() - time) + \" ms\");\n\n assertEquals(Arrays.asList(\"弹道导弹\"), tokenizer.token... | {
"fields": [
{
"declarator": "TOKENIZER = new LanguageToolTokenizer(new Chinese())",
"modifier": "private static final",
"original_string": "private static final LanguageToolTokenizer TOKENIZER = new LanguageToolTokenizer(new Chinese());",
"type": "LanguageToolTokenizer",
"var_name"... | {
"body": "@Override\n public List<String> tokenize(final String sentence) {\n return TOKENIZER.tokenize(sentence);\n }",
"class_method_signature": "ChineseWordTokenizer.tokenize(final String sentence)",
"constructor": false,
"full_signature": "@Override public List<String> tokenize(final String se... | {
"created": null,
"fork": null,
"fork_count": 128,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21477166,
"size": 38207,
"stargazer_count": 429,
"stars": null,
"updates": null,
"url": "https://github.com/kennycason/kumo"
} |
135332674_3 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testSavedDecryption() {\n // No saved ciphertexts.\n decrypterManager.decryptSaved(handler, extra);\n verifyZeroInteractions(handler);\n\n // Save ciphertexts.\n int ciphertextCount = 10;\n ciphertextBuilder.setIsAuthKey(true);\n byte[] ciphertextBytes = ciphertext... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decryptSaved(CapillaryHandler handler, Object extra) {\n List<byte[]> ciphertexts = ciphertextStorage.get();\n ciphertextStorage.clear();\n for (byte[] data : ciphertexts) {\n decrypt(data, handler, extra);\n }\n }",
"class_method_signature": "DecrypterManager.d... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_12 | {
"fields": [
{
"declarator": "encrypterManager",
"modifier": "private",
"original_string": "private WebPushEncrypterManager encrypterManager;",
"type": "WebPushEncrypterManager",
"var_name": "encrypterManager"
}
],
"file": "lib/src/test/java/com/google/capillary/WebPushEncry... | {
"body": "@Test\n public void testLoadValidRawPublicKey() throws IOException, GeneralSecurityException {\n byte[] authSecret = Random.randBytes(16);\n byte[] ecPublicKeyBytes = TestUtils.getBytes(\"ec_public_key.dat\");\n byte[] rawPublicKey = WrappedWebPushPublicKey.newBuilder()\n .setAuthSecret(By... | {
"fields": [],
"file": "lib/src/main/java/com/google/capillary/WebPushEncrypterManager.java",
"identifier": "WebPushEncrypterManager",
"interfaces": "",
"methods": [
{
"class_method_signature": "WebPushEncrypterManager.rawLoadPublicKey(byte[] publicKey)",
"constructor": false,
"full_sig... | {
"body": "@Override\n HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n WrappedWebPushPublicKey wrappedWebPushPublicKey;\n try {\n wrappedWebPushPublicKey = WrappedWebPushPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw new ... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_13 | {
"fields": [
{
"declarator": "MOCK_CIPHERTEXT = \"mock ciphertext\"",
"modifier": "private static final",
"original_string": "private static final String MOCK_CIPHERTEXT = \"mock ciphertext\";",
"type": "String",
"var_name": "MOCK_CIPHERTEXT"
},
{
"declarator": "PLAINT... | {
"body": "@Test\n public void testLoadValidPublicKey() throws GeneralSecurityException {\n encrypterManager.loadPublicKey(publicKey.toByteArray());\n }",
"class_method_signature": "EncrypterManagerTest.testLoadValidPublicKey()",
"constructor": false,
"full_signature": "@Test public void testLoadValidPubli... | {
"fields": [
{
"declarator": "isLoaded",
"modifier": "private",
"original_string": "private boolean isLoaded;",
"type": "boolean",
"var_name": "isLoaded"
},
{
"declarator": "capillaryPublicKey",
"modifier": "private",
"original_string": "private CapillaryPu... | {
"body": "public synchronized void loadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n try {\n capillaryPublicKey = CapillaryPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw new GeneralSecurityException(\"unable to parse public key\", e);\n }\n... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_2 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testAuthCiphertextsSavedWithNewScreenLock() throws Exception {\n // Emulate a newly added screen lock on a device with API level 23 or later.\n TestUtils.setBuildVersion(VERSION_CODES.M);\n when(hybridDecrypt.decrypt(any(byte[].class), any(byte[].class)))\n .thenThrow(n... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_14 | {
"fields": [
{
"declarator": "MOCK_CIPHERTEXT = \"mock ciphertext\"",
"modifier": "private static final",
"original_string": "private static final String MOCK_CIPHERTEXT = \"mock ciphertext\";",
"type": "String",
"var_name": "MOCK_CIPHERTEXT"
},
{
"declarator": "PLAINT... | {
"body": "@Test\n public void testLoadMalformedPublicKey() {\n byte[] publicKey = \"malformed public key\".getBytes();\n\n try {\n encrypterManager.loadPublicKey(publicKey);\n fail(\"Did not throw GeneralSecurityException\");\n } catch (GeneralSecurityException e) {\n // This is expected.\n ... | {
"fields": [
{
"declarator": "isLoaded",
"modifier": "private",
"original_string": "private boolean isLoaded;",
"type": "boolean",
"var_name": "isLoaded"
},
{
"declarator": "capillaryPublicKey",
"modifier": "private",
"original_string": "private CapillaryPu... | {
"body": "public synchronized void loadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n try {\n capillaryPublicKey = CapillaryPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw new GeneralSecurityException(\"unable to parse public key\", e);\n }\n... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_9 | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "recipientPublicKey",
"modifier": "private final",
... | {
"body": "@Test\n public void testEncryptDecrypt() throws IOException, GeneralSecurityException {\n PublicKeyVerify senderVerifier = TestUtils.createTestSenderVerifier();\n PrivateKey recipientPrivateKey = TestUtils.createTestRsaPrivateKey();\n\n // Try Encryption/Decryption for each padding mode.\n for... | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "recipientPublicKey",
"modifier": "private final",
... | {
"body": "@Override\n public byte[] encrypt(byte[] plaintext, byte[] contextInfo /* unused */)\n throws GeneralSecurityException {\n if (contextInfo != null) {\n throw new GeneralSecurityException(\"contextInfo must be null because it is unused\");\n }\n\n try {\n byte[] unsignedCiphertext =... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_18 | {
"fields": [
{
"declarator": "encrypterManager",
"modifier": "private",
"original_string": "private RsaEcdsaEncrypterManager encrypterManager;",
"type": "RsaEcdsaEncrypterManager",
"var_name": "encrypterManager"
}
],
"file": "lib/src/test/java/com/google/capillary/RsaEcdsaEn... | {
"body": "@Test\n public void testLoadValidRawPublicKey() throws IOException, GeneralSecurityException {\n byte[] testRsaPublicKey = TestUtils.getBytes(\"rsa_public_key.dat\");\n byte[] rawPublicKey = WrappedRsaEcdsaPublicKey.newBuilder()\n .setPadding(Padding.OAEP.name())\n .setKeyBytes(ByteStr... | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
}
],
"file": "lib/src/main/java/com/google/capillary/RsaEcdsaEncrypterManager.java",
... | {
"body": "@Override\n HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n WrappedRsaEcdsaPublicKey wrappedRsaEcdsaPublicKey;\n try {\n wrappedRsaEcdsaPublicKey = WrappedRsaEcdsaPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw ... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_5 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testMalformedCiphertext() {\n byte[] ciphertextBytes = \"malformed ciphertext\".getBytes();\n decrypterManager.decrypt(ciphertextBytes, handler, extra);\n verify(handler).error(CapillaryHandlerErrorCode.MALFORMED_CIPHERTEXT, ciphertextBytes, extra);\n\n verifyNoMoreInteract... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_4 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testSavedDecryptionWithScreenLock() {\n // Lock the screen.\n when(utils.isScreenLocked(context)).thenReturn(true);\n\n // No saved ciphertexts.\n decrypterManager.decryptSaved(handler, extra);\n verifyZeroInteractions(handler);\n\n // Save ciphertexts.\n int ciphe... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decryptSaved(CapillaryHandler handler, Object extra) {\n List<byte[]> ciphertexts = ciphertextStorage.get();\n ciphertextStorage.clear();\n for (byte[] data : ciphertexts) {\n decrypt(data, handler, extra);\n }\n }",
"class_method_signature": "DecrypterManager.d... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_19 | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "senderVerifier",
"modifier": "private final",
"... | {
"body": "@Test\n public void testModifyCiphertext() throws GeneralSecurityException {\n byte[] plaintext = Random.randBytes(20);\n\n // Try Encryption/Decryption for each padding mode.\n for (Padding padding : Padding.values()) {\n HybridEncrypt hybridEncrypt = new RsaEcdsaHybridEncrypt.Builder()\n ... | {
"fields": [
{
"declarator": "senderVerifier",
"modifier": "private final",
"original_string": "private final PublicKeyVerify senderVerifier;",
"type": "PublicKeyVerify",
"var_name": "senderVerifier"
},
{
"declarator": "recipientPrivateKey",
"modifier": "private ... | {
"body": "@Override\n public byte[] decrypt(byte[] ciphertext, byte[] contextInfo) throws GeneralSecurityException {\n if (contextInfo != null) {\n throw new GeneralSecurityException(\"contextInfo must be null because it is unused\");\n }\n\n try {\n byte[] verifiedCiphertext = deserializeAndVeri... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_8 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testUnknownError()\n throws NoSuchKeyException, GeneralSecurityException, AuthModeUnavailableException {\n when(keyManager.getDecrypter(anyString(), anyInt(), anyBoolean()))\n .thenThrow(new GeneralSecurityException(\"unknown exception\"));\n\n ciphertextBuilder.setIs... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_15 | {
"fields": [
{
"declarator": "MOCK_CIPHERTEXT = \"mock ciphertext\"",
"modifier": "private static final",
"original_string": "private static final String MOCK_CIPHERTEXT = \"mock ciphertext\";",
"type": "String",
"var_name": "MOCK_CIPHERTEXT"
},
{
"declarator": "PLAINT... | {
"body": "@Test\n public void testClearPublicKey() throws GeneralSecurityException {\n encrypterManager.loadPublicKey(publicKey.toByteArray());\n\n encrypterManager.clearPublicKey();\n }",
"class_method_signature": "EncrypterManagerTest.testClearPublicKey()",
"constructor": false,
"full_signature": "@T... | {
"fields": [
{
"declarator": "isLoaded",
"modifier": "private",
"original_string": "private boolean isLoaded;",
"type": "boolean",
"var_name": "isLoaded"
},
{
"declarator": "capillaryPublicKey",
"modifier": "private",
"original_string": "private CapillaryPu... | {
"body": "public synchronized void clearPublicKey() {\n isLoaded = false;\n capillaryPublicKey = null;\n encrypter = null;\n }",
"class_method_signature": "EncrypterManager.clearPublicKey()",
"constructor": false,
"full_signature": "public synchronized void clearPublicKey()",
"identifier": "clearPu... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_16 | {
"fields": [
{
"declarator": "MOCK_CIPHERTEXT = \"mock ciphertext\"",
"modifier": "private static final",
"original_string": "private static final String MOCK_CIPHERTEXT = \"mock ciphertext\";",
"type": "String",
"var_name": "MOCK_CIPHERTEXT"
},
{
"declarator": "PLAINT... | {
"body": "@Test\n public void testEncryptionWithNoPublicKey() {\n try {\n encrypterManager.encrypt(PLAINTEXT.getBytes());\n fail(\"Did not throw GeneralSecurityException\");\n } catch (GeneralSecurityException e) {\n // This is expected.\n }\n }",
"class_method_signature": "EncrypterManag... | {
"fields": [
{
"declarator": "isLoaded",
"modifier": "private",
"original_string": "private boolean isLoaded;",
"type": "boolean",
"var_name": "isLoaded"
},
{
"declarator": "capillaryPublicKey",
"modifier": "private",
"original_string": "private CapillaryPu... | {
"body": "public synchronized byte[] encrypt(byte[] data) throws GeneralSecurityException {\n if (!isLoaded) {\n throw new GeneralSecurityException(\"public key is not loaded\");\n }\n byte[] ciphertext = encrypter.encrypt(data, null);\n return CapillaryCiphertext.newBuilder()\n .setKeychainU... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_20 | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "senderVerifier",
"modifier": "private final",
"... | {
"body": "@Test\n public void testNonNullContextInfo() throws GeneralSecurityException {\n HybridEncrypt hybridEncrypt = new RsaEcdsaHybridEncrypt.Builder()\n .withSenderSigner(senderSigner)\n .withRecipientPublicKey(recipientPublicKey)\n .withPadding(Padding.PKCS1)\n .build();\n H... | {
"fields": [
{
"declarator": "senderVerifier",
"modifier": "private final",
"original_string": "private final PublicKeyVerify senderVerifier;",
"type": "PublicKeyVerify",
"var_name": "senderVerifier"
},
{
"declarator": "recipientPrivateKey",
"modifier": "private ... | {
"body": "@Override\n public byte[] decrypt(byte[] ciphertext, byte[] contextInfo) throws GeneralSecurityException {\n if (contextInfo != null) {\n throw new GeneralSecurityException(\"contextInfo must be null because it is unused\");\n }\n\n try {\n byte[] verifiedCiphertext = deserializeAndVeri... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_7 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testAuthModeUnavailable()\n throws GeneralSecurityException, NoSuchKeyException, AuthModeUnavailableException {\n when(keyManager.getDecrypter(anyString(), anyInt(), anyBoolean()))\n .thenThrow(new AuthModeUnavailableException(\"no auth mode in device\"));\n\n ciphert... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_6 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testMissingKey()\n throws NoSuchKeyException, GeneralSecurityException, AuthModeUnavailableException {\n when(keyManager.getDecrypter(anyString(), anyInt(), anyBoolean()))\n .thenThrow(new NoSuchKeyException(\"no such key\"));\n\n byte[] ciphertextBytes = ciphertextBu... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_17 | {
"fields": [
{
"declarator": "encrypterManager",
"modifier": "private",
"original_string": "private RsaEcdsaEncrypterManager encrypterManager;",
"type": "RsaEcdsaEncrypterManager",
"var_name": "encrypterManager"
}
],
"file": "lib/src/test/java/com/google/capillary/RsaEcdsaEn... | {
"body": "@Test\n public void testLoadMalformedRawPublicKey() {\n byte[] rawPublicKey = \"malformed raw public key\".getBytes();\n\n try {\n encrypterManager.rawLoadPublicKey(rawPublicKey);\n fail(\"Did not throw GeneralSecurityException\");\n } catch (GeneralSecurityException e) {\n // This... | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
}
],
"file": "lib/src/main/java/com/google/capillary/RsaEcdsaEncrypterManager.java",
... | {
"body": "@Override\n HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n WrappedRsaEcdsaPublicKey wrappedRsaEcdsaPublicKey;\n try {\n wrappedRsaEcdsaPublicKey = WrappedRsaEcdsaPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw ... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_1 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testAuthCiphertextsSaved() {\n // Lock the screen.\n when(utils.isScreenLocked(context)).thenReturn(true);\n\n // Try to decrypt auth ciphertext while screen is locked.\n ciphertextBuilder.setIsAuthKey(true);\n byte[] ciphertextBytes = ciphertextBuilder.build().toByteArr... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_10 | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "recipientPublicKey",
"modifier": "private final",
... | {
"body": "@Test\n public void testNonNullContextInfo() {\n HybridEncrypt hybridEncrypt = new RsaEcdsaHybridEncrypt.Builder()\n .withSenderSigner(senderSigner)\n .withRecipientPublicKey(recipientPublicKey)\n .withPadding(Padding.PKCS1)\n .build();\n\n byte[] plaintext = Random.randB... | {
"fields": [
{
"declarator": "senderSigner",
"modifier": "private final",
"original_string": "private final PublicKeySign senderSigner;",
"type": "PublicKeySign",
"var_name": "senderSigner"
},
{
"declarator": "recipientPublicKey",
"modifier": "private final",
... | {
"body": "@Override\n public byte[] encrypt(byte[] plaintext, byte[] contextInfo /* unused */)\n throws GeneralSecurityException {\n if (contextInfo != null) {\n throw new GeneralSecurityException(\"contextInfo must be null because it is unused\");\n }\n\n try {\n byte[] unsignedCiphertext =... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_11 | {
"fields": [
{
"declarator": "encrypterManager",
"modifier": "private",
"original_string": "private WebPushEncrypterManager encrypterManager;",
"type": "WebPushEncrypterManager",
"var_name": "encrypterManager"
}
],
"file": "lib/src/test/java/com/google/capillary/WebPushEncry... | {
"body": "@Test\n public void testLoadMalformedRawPublicKey() {\n byte[] rawPublicKey = \"malformed raw public key\".getBytes();\n\n try {\n encrypterManager.rawLoadPublicKey(rawPublicKey);\n fail(\"Did not throw GeneralSecurityException\");\n } catch (GeneralSecurityException e) {\n // This... | {
"fields": [],
"file": "lib/src/main/java/com/google/capillary/WebPushEncrypterManager.java",
"identifier": "WebPushEncrypterManager",
"interfaces": "",
"methods": [
{
"class_method_signature": "WebPushEncrypterManager.rawLoadPublicKey(byte[] publicKey)",
"constructor": false,
"full_sig... | {
"body": "@Override\n HybridEncrypt rawLoadPublicKey(byte[] publicKey) throws GeneralSecurityException {\n WrappedWebPushPublicKey wrappedWebPushPublicKey;\n try {\n wrappedWebPushPublicKey = WrappedWebPushPublicKey.parseFrom(publicKey);\n } catch (InvalidProtocolBufferException e) {\n throw new ... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
135332674_0 | {
"fields": [
{
"declarator": "PLAINTEXT = \"plaintext\"",
"modifier": "private static final",
"original_string": "private static final String PLAINTEXT = \"plaintext\";",
"type": "String",
"var_name": "PLAINTEXT"
},
{
"declarator": "CIPHERTEXT = \"ciphertext\"",
... | {
"body": "@Test\n public void testRegularDecryption()\n throws NoSuchKeyException, GeneralSecurityException, AuthModeUnavailableException {\n // Decrypt no-auth ciphertext.\n ciphertextBuilder.setIsAuthKey(false);\n decrypterManager.decrypt(ciphertextBuilder.build().toByteArray(), handler, extra);\n ... | {
"fields": [
{
"declarator": "context",
"modifier": "private final",
"original_string": "private final Context context;",
"type": "Context",
"var_name": "context"
},
{
"declarator": "ciphertextStorage",
"modifier": "private final",
"original_string": "priva... | {
"body": "public synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra) {\n // Parse the given ciphertext bytes.\n CapillaryCiphertext capillaryCiphertext;\n try {\n capillaryCiphertext = CapillaryCiphertext.parseFrom(ciphertext);\n } catch (InvalidProtocolBufferExcepti... | {
"created": null,
"fork": null,
"fork_count": 35,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 135332674,
"size": 942,
"stargazer_count": 437,
"stars": null,
"updates": null,
"url": "https://github.com/google/capillary"
} |
96123627_105 | {
"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 testUpsertDataFailureWithEmptyMap() {\n Map<String, Object> innermap = new HashMap<>();\n Future<Boolean> response =\n esService.upsert(INDEX_NAME, (String) chemistryMap.get(\"courseId\"), innermap);\n boolean result = (boolean) ElasticSearchHelper.getResponseFromFuture... | {
"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_27 | {
"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 extractScriptNameRootLocation() {\n CqlMigrationResolver cqlMigrationResolver =\n new CqlMigrationResolver(\n Thread.currentThread().getContextClassLoader(), new ScriptsLocation(\"\"), \"UTF-8\");\n\n assertEquals(\n \"db_0__init.cql\",\n cqlMigrat... | {
"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_294 | {
"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 testValidateCountryCode() {\n boolean isValid = ProjectUtil.validateCountryCode(\"+91\");\n assertTrue(isValid);\n }",
"class_method_signature": "ProjectUtilTest.testValidateCountryCode()",
"constructor": false,
"full_signature": "@Test public void testValidateCountryCode(... | {
"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 validateCountryCode(String countryCode) {\n String pattern = \"^(?:[+] ?){0,1}(?:[0-9] ?){1,3}\";\n try {\n Pattern patt = Pattern.compile(pattern);\n Matcher matcher = patt.matcher(countryCode);\n return matcher.matches();\n } catch (RuntimeException e) {\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_70 | {
"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 testSaveFailureWithEmptyIndex() {\n\n Future<String> result = esService.save(\"\", \"001\", new HashMap<>());\n String res = (String) ElasticSearchHelper.getResponseFromFuture(result);\n assertEquals(\"ERROR\", res);\n }",
"class_method_signature": "ElasticSearchRestHighImp... | {
"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_89 | {
"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 testBuilInsertSuccess() {\n mockRulesForBulk(false);\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\", ... | {
"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_66 | {
"fields": [],
"file": "sunbird-es-utils/src/test/java/org/sunbird/common/factory/EsClientFactoryTest.java",
"identifier": "EsClientFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetTcpClient() {\n\t\tElasticSearchService service = EsClientFactory.getInstance(\"tcp\");\n\t\tAssert.assertTrue(service instanceof ElasticSearchTcpImpl);\n\t}",
"class_method_signature": "EsClientFactoryTest.testGetTcpClient()",
"constructor": false,
"full_signature": "@Tes... | {
"fields": [
{
"declarator": "tcpClient = null",
"modifier": "private static",
"original_string": "private static ElasticSearchService tcpClient = null;",
"type": "ElasticSearchService",
"var_name": "tcpClient"
},
{
"declarator": "restClient = null",
"modifier": ... | {
"body": "private static ElasticSearchService getTcpClient() {\n if (tcpClient == null) {\n tcpClient = new ElasticSearchTcpImpl();\n }\n return tcpClient;\n }",
"class_method_signature": "EsClientFactory.getTcpClient()",
"constructor": false,
"full_signature": "private static ElasticSearchServi... | {
"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_282 | {
"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 testCreateAndThrowInvalidUserDataExceptionSuccess() {\n try {\n ProjectUtil.createAndThrowInvalidUserDataException();\n } catch (ProjectCommonException e) {\n assertEquals(ResponseCode.CLIENT_ERROR.getResponseCode(), e.getResponseCode());\n assertEquals(ResponseCod... | {
"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 createAndThrowInvalidUserDataException() {\n throw new ProjectCommonException(\n ResponseCode.invalidUsrData.getErrorCode(),\n ResponseCode.invalidUsrData.getErrorMessage(),\n ResponseCode.CLIENT_ERROR.getResponseCode());\n }",
"class_method_signature": "Projec... | {
"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_31 | {
"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 empty() {\n assertEquals(MigrationVersion.EMPTY, MigrationVersion.EMPTY);\n assertTrue(MigrationVersion.EMPTY.compareTo(MigrationVersion.EMPTY) == 0);\n }",
"class_method_signature": "MigrationVersionTest.empty()",
"constructor": false,
"full_signature": "@Test public void... | {
"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_168 | {
"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 testValidateEnrolmentTypeFailureWithEmptyType() {\n try {\n RequestValidator.validateEnrolmentType(\"\");\n } catch (ProjectCommonException e) {\n assertEquals(ResponseCode.CLIENT_ERROR.getResponseCode(), e.getResponseCode());\n assertEquals(ResponseCode.enrolmentT... | {
"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_3 | {
"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 sendEmailWithCCTest() throws MessagingException {\n List<String> emailList = new ArrayList<String>();\n emailList.add(\"testmail@test.com\"); emailList.add(\"test1@test.com\");\n List<String> ccEmailList = new ArrayList<String>();\n ccEmailList.add(\"testmailcc@test.com\");... | {
"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 boolean sendMail(List<String> emailList, String subject, String body) {\n return sendMail(emailList, subject, body, null);\n }",
"class_method_signature": "Email.sendMail(List<String> emailList, String subject, String body)",
"constructor": false,
"full_signature": "public boolean sendMail... | {
"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_241 | {
"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 testValidateCreateUserFailureWithInvalidJobProfileEndDate() {\n Request request = initailizeRequest();\n Map<String, Object> map = new HashMap<>();\n map.put(JsonKey.JOB_NAME, \"kijklo\");\n map.put(JsonKey.ORG_NAME, \"degree\");\n map.put(JsonKey.END_DATE, \"20-15-18\")... | {
"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_216 | {
"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 testPhoneValidationFailureWithPhoneVerifiedNull() {\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_129 | {
"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 testAddUserLoginTimeSuccess() {\n boolean response = keyCloakService.addUserLoginTime(userId.get(JsonKey.USER_ID));\n Assert.assertEquals(true, response);\n }",
"class_method_signature": "KeyCloakServiceImplTest.testAddUserLoginTimeSuccess()",
"constructor": false,
"full_s... | {
"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 boolean addUserLoginTime(String userId) {\n boolean response = true;\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_200 | {
"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 testValidateForgotPasswordSuccess() {\n Request request = new Request();\n boolean response = false;\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.USERNAME, \"manzarul07\");\n request.setRequest(requestObj);\n try {\n userRequestVal... | {
"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 validateForgotPassword(Request request) {\n if (request.getRequest().get(JsonKey.USERNAME) == null\n || StringUtils.isBlank((String) request.getRequest().get(JsonKey.USERNAME))) {\n throw new ProjectCommonException(\n ResponseCode.userNameRequired.getErrorCode(),\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_191 | {
"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 testValidateCreateUserBasicValidationFailure() {\n Request request = initailizeRequest();\n Map<String, Object> requestObj = request.getRequest();\n requestObj.put(JsonKey.ROLES, \"admin\");\n request.setRequest(requestObj);\n try {\n userRequestValidator.createUser... | {
"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_312 | {
"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 testGetAllRecordsSuccess() throws Exception {\n Iterator<Row> rowItr = Mockito.mock(Iterator.class);\n Mockito.when(resultSet.iterator()).thenReturn(rowItr);\n PowerMockito.whenNew(BoundStatement.class)\n .withArguments(Mockito.any(PreparedStatement.class))\n .th... | {
"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 getAllRecords(String keyspaceName, String tableName) {\n long startTime = System.currentTimeMillis();\n ProjectLogger.log(\n \"Cassandra Service getAllRecords method started at ==\" + startTime, LoggerEnum.INFO);\n Response response = new Response();\n try {\... | {
"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_257 | {
"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 testCreateAuthTokenSuccess() {\n String authToken = ProjectUtil.createAuthToken(\"test\", \"tset1234\");\n assertNotNull(authToken);\n }",
"class_method_signature": "ProjectUtilTest.testCreateAuthTokenSuccess()",
"constructor": false,
"full_signature": "@Test public void t... | {
"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 createAuthToken(String name, String source) {\n String data = name + source + System.currentTimeMillis();\n UUID authId = UUID.nameUUIDFromBytes(data.getBytes(StandardCharsets.UTF_8));\n return authId.toString();\n }",
"class_method_signature": "ProjectUtil.createAuthToken(... | {
"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_220 | {
"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 testValidateWebPagesFailureWithEmptyWebPages() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.WEB_PAGES, new ArrayList<>());\n request.setRequest(requestObj);\n try {\n userRequestValidator.validateW... | {
"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": "@SuppressWarnings(\"unchecked\")\n public void validateWebPages(Request request) {\n if (request.getRequest().containsKey(JsonKey.WEB_PAGES)) {\n List<Map<String, String>> data =\n (List<Map<String, String>>) request.getRequest().get(JsonKey.WEB_PAGES);\n if (null == data || data.isE... | {
"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_109 | {
"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 testRemoveDataFailureByIdentifierEmpty() {\n Future<Boolean> response = esService.delete(INDEX_NAME, \"\");\n boolean result = (boolean) ElasticSearchHelper.getResponseFromFuture(response);\n assertEquals(false, result);\n }",
"class_method_signature": "ElasticSearchTcpImpl... | {
"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> delete(String index, String identifier) {\n long startTime = System.currentTimeMillis();\n Promise<Boolean> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:delete: method started at ==\" + startTime,\n LoggerEnum.PERF_LOG... | {
"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_93 | {
"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 testUpdateDataSuccess() {\n Map<String, Object> innermap = new HashMap<>();\n innermap.put(\"courseName\", \"Updated course name\");\n innermap.put(\"organisationId\", \"updatedOrgId\");\n\n GetRequestBuilder grb = mock(GetRequestBuilder.class);\n GetResponse getResponse... | {
"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> update(String index, String identifier, Map<String, Object> data) {\n long startTime = System.currentTimeMillis();\n Promise<Boolean> promise = Futures.promise();\n ProjectLogger.log(\n \"ElasticSearchTcpImpl:update: 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_277 | {
"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 testEnvironmentSuccess() {\n assertEquals(1, ProjectUtil.Environment.dev.getValue());\n assertEquals(2, ProjectUtil.Environment.qa.getValue());\n assertEquals(3, ProjectUtil.Environment.prod.getValue());\n }",
"class_method_signature": "ProjectUtilTest.testEnvironmentSucces... | {
"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_298 | {
"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 testSendPostRequestSuccess() {\n Map<String, String> headers = new HashMap<>();\n headers.put(\"Authorization\", \"123456\");\n String url = \"http://localhost:8000/v1/issuer/issuers\";\n try {\n String response = HttpUtil.sendPostRequest(url, \"{\\\"message\\\":\\\"su... | {
"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 sendPostRequest(\n String requestURL, Map<String, String> params, Map<String, String> headers)\n throws IOException {\n long startTime = System.currentTimeMillis();\n Map<String, Object> logInfo = genarateLogInfo(JsonKey.API_CALL, \"API CALL : \" + requestURL);\n Htt... | {
"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_261 | {
"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 testCreateCheckResponseSuccess() {\n Map<String, Object> responseMap =\n ProjectUtil.createCheckResponse(\"LearnerService\", false, null);\n assertEquals(true, responseMap.get(JsonKey.Healthy));\n }",
"class_method_signature": "ProjectUtilTest.testCreateCheckResponseSuc... | {
"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_85 | {
"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 testUpsertSuccess() {\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_324 | {
"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 testGetRecordsSuccessById() {\n Iterator<Row> rowItr = Mockito.mock(Iterator.class);\n Mockito.when(resultSet.iterator()).thenReturn(rowItr);\n when(session.execute(where)).thenReturn(resultSet);\n when(selectSelection.all()).thenReturn(selectBuilder);\n\n Response respo... | {
"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 getRecordById(String keyspaceName, String tableName, String key) {\n return getRecordByIdentifier(keyspaceName, tableName, key, null);\n }",
"class_method_signature": "CassandraOperationImpl.getRecordById(String keyspaceName, String tableName, String key)",
"constructor... | {
"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_236 | {
"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 testValidateCreateUserFailureWithEmptyEducationAddress() {\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, \"degre... | {
"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_308 | {
"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 testUpdateRecordSuccess() {\n\n address.put(JsonKey.CITY, \"city\");\n address.put(JsonKey.ADD_TYPE, \"addrType\");\n\n when(session.execute(boundStatement)).thenReturn(resultSet);\n Response response = operation.updateRecord(cassandraKeySpace, \"address\", address);\n a... | {
"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"
} |
96123627_46 | {
"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 mergeLocationsDuplicate() {\n ScriptsLocations locations =\n new ScriptsLocations(\"db/locations\", \"db/migration\", \"db/migration\");\n List<ScriptsLocation> locationList = locations.getLocations();\n assertEquals(2, locationList.size());\n Iterator<ScriptsLocatio... | {
"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_164 | {
"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 testValidateSendEmailSuccess() {\n boolean response = false;\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.SUBJECT, \"test123\");\n requestObj.put(JsonKey.BODY, \"test\");\n List<String> data = new Arra... | {
"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_11 | {
"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 resolveMigrationsMultipleLocations() {\n MigrationResolver migrationResolver =\n new CompositeMigrationResolver(\n Thread.currentThread().getContextClassLoader(),\n new ScriptsLocations(\n \"migration/subdir/dir2\", \"migration.outoforder\... | {
"fields": [
{
"declarator": "migrationResolvers = new ArrayList<MigrationResolver>()",
"modifier": "private",
"original_string": "private Collection<MigrationResolver> migrationResolvers = new ArrayList<MigrationResolver>();",
"type": "Collection<MigrationResolver>",
"var_name": "m... | {
"body": "public List<ResolvedMigration> resolveMigrations() {\n if (availableMigrations == null) {\n availableMigrations = doFindAvailableMigrations();\n }\n\n return availableMigrations;\n }",
"class_method_signature": "CompositeMigrationResolver.resolveMigrations()",
"constructor": false,
"fu... | {
"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_133 | {
"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 testSetEmailVerifiedSuccessWithVerifiedTrue() {\n String response = keyCloakService.setEmailVerifiedTrue(userId.get(JsonKey.USER_ID));\n Assert.assertEquals(JsonKey.SUCCESS, response);\n }",
"class_method_signature": "KeyCloakServiceImplTest.testSetEmailVerifiedSuccessWithVeri... | {
"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 setEmailVerifiedTrue(String userId) {\n updateEmailVerifyStatus(userId, true);\n return JsonKey.SUCCESS;\n }",
"class_method_signature": "KeyCloakServiceImpl.setEmailVerifiedTrue(String userId)",
"constructor": false,
"full_signature": "@Override public String setEma... | {
"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_125 | {
"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 testUpdateUserSuccessWithoutAnyField() {\n\n Map<String, Object> request = new HashMap<String, Object>();\n request.put(JsonKey.USER_ID, userId.get(JsonKey.USER_ID));\n String result = keyCloakService.updateUser(request);\n Assert.assertNotNull(result);\n }",
"class_meth... | {
"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 updateUser(Map<String, Object> request) {\n String userId = (String) request.get(JsonKey.USER_ID);\n String fedUserId = getFederatedUserId(userId);\n UserRepresentation ur = null;\n UserResource resource = null;\n boolean needTobeUpdate = false;\n try {\n r... | {
"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_50 | {
"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 mergeLocationsSimilarButNoOverlapHyphen() {\n ScriptsLocations locations =\n new ScriptsLocations(\"db/migration/oracle\", \"db/migration\", \"db/migration-test\");\n List<ScriptsLocation> locationList = locations.getLocations();\n assertEquals(2, locationList.size());\... | {
"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_172 | {
"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 testValidateSyncRequestSuccess() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.OPERATION_FOR, \"keycloak\");\n requestObj.put(JsonKey.OBJECT_TYPE, JsonKey.USER);\n request.setRequest(requestObj);\n bo... | {
"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 validateSyncRequest(Request request) {\n String operation = (String) request.getRequest().get(JsonKey.OPERATION_FOR);\n if ((null != operation) && (!operation.equalsIgnoreCase(\"keycloak\"))) {\n if (request.getRequest().get(JsonKey.OBJECT_TYPE) == null) {\n throw new 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_173 | {
"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 testValidateSyncRequestFailureWithNullObjectType() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.OPERATION_FOR, \"not keycloack\");\n requestObj.put(JsonKey.OBJECT_TYPE, null);\n request.setRequest(reque... | {
"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 validateSyncRequest(Request request) {\n String operation = (String) request.getRequest().get(JsonKey.OPERATION_FOR);\n if ((null != operation) && (!operation.equalsIgnoreCase(\"keycloak\"))) {\n if (request.getRequest().get(JsonKey.OBJECT_TYPE) == null) {\n throw new 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_51 | {
"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 trimOrPad() {\n assertEquals(\"Hello World \", StringUtils.trimOrPad(\"Hello World\", 15));\n assertEquals(\"Hello Worl\", StringUtils.trimOrPad(\"Hello World\", 10));\n assertEquals(\" \", StringUtils.trimOrPad(null, 10));\n }",
"class_method_signature": "Strin... | {
"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 trimOrPad(String str, int length) {\n return trimOrPad(str, length, ' ');\n }",
"class_method_signature": "StringUtils.trimOrPad(String str, int length)",
"constructor": false,
"full_signature": "public static String trimOrPad(String str, int length)",
"identifier": "trimOr... | {
"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_124 | {
"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 testUpdateUserSuccessWithoutProviderAndCountryCode() {\n Map<String, Object> request = new HashMap<String, Object>();\n request.put(JsonKey.USER_ID, userId.get(JsonKey.USER_ID));\n request.put(JsonKey.FIRST_NAME, userName);\n request.put(JsonKey.PHONE, \"9870060000\");\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 updateUser(Map<String, Object> request) {\n String userId = (String) request.get(JsonKey.USER_ID);\n String fedUserId = getFederatedUserId(userId);\n UserRepresentation ur = null;\n UserResource resource = null;\n boolean needTobeUpdate = false;\n try {\n r... | {
"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_132 | {
"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 testIsEmailVerifiedSuccess() {\n boolean response = keyCloakService.isEmailVerified(userId.get(JsonKey.USER_ID));\n Assert.assertEquals(false, response);\n }",
"class_method_signature": "KeyCloakServiceImplTest.testIsEmailVerifiedSuccess()",
"constructor": false,
"full_sig... | {
"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 boolean isEmailVerified(String userId) {\n String fedUserId = getFederatedUserId(userId);\n UserResource resource =\n keycloak.realm(KeyCloakConnectionProvider.SSO_REALM).users().get(fedUserId);\n if (isNull(resource)) {\n return false;\n }\n return resource.t... | {
"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_10 | {
"fields": [],
"file": "sunbird-cassandra-migration/cassandra-migration/src/test/java/com/contrastsecurity/cassandra/migration/resolver/java/JavaMigrationResolverTest.java",
"identifier": "JavaMigrationResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void explicitInfo() {\n JavaMigrationResolver jdbcMigrationResolver =\n new JavaMigrationResolver(Thread.currentThread().getContextClassLoader(), null);\n ResolvedMigration migrationInfo =\n jdbcMigrationResolver.extractMigrationInfo(new Version3dot5());\n assertEqual... | {
"fields": [
{
"declarator": "location",
"modifier": "private final",
"original_string": "private final ScriptsLocation location;",
"type": "ScriptsLocation",
"var_name": "location"
},
{
"declarator": "classLoader",
"modifier": "private",
"original_string":... | {
"body": "ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) {\n Integer checksum = null;\n if (javaMigration instanceof MigrationChecksumProvider) {\n MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration;\n checksum = checksumProvider.getChecksum();... | {
"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_165 | {
"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 testValidateSendMailFailureWithNullRecipients() {\n Request request = new Request();\n Map<String, Object> requestObj = new HashMap<>();\n requestObj.put(JsonKey.SUBJECT, \"test123\");\n requestObj.put(JsonKey.BODY, \"test\");\n requestObj.put(JsonKey.RECIPIENT_EMAILS, 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_309 | {
"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 testUpdateRecordWithTTLSuccess() {\n when(resultSet.iterator()).thenReturn(iterator);\n Map<String, Object> compositeKey = new HashMap<>();\n compositeKey.put(JsonKey.TYPE, JsonKey.EMAIL);\n compositeKey.put(JsonKey.KEY, \"amit@example.com\");\n when(session.execute(upda... | {
"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 updateRecordWithTTL(\n String keyspaceName,\n String tableName,\n Map<String, Object> request,\n Map<String, Object> compositeKey,\n int ttl) {\n long startTime = System.currentTimeMillis();\n Session session = connectionManager.getSession(keyspac... | {
"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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.