id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
88544701_69
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnError() {\n uut.onError(new IOException());\n verify(factObserver).onError(any());\n }", "class_method_signature": "ClientStreamObserverTest.testOnError()", "constructor": false, "full_signature": "@Test void testOnError()", "identifier": "testOnError", "inv...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onError(Throwable t) {\n subscription.notifyError(t);\n }", "class_method_signature": "ClientStreamObserver.onError(Throwable t)", "constructor": false, "full_signature": "@Override public void onError(Throwable t)", "identifier": "onError", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_170
{ "fields": [ { "declarator": "uut = new LockedOperationBuilder(mock(FactStore.class), \"ns\")", "modifier": "", "original_string": "LockedOperationBuilder uut = new LockedOperationBuilder(mock(FactStore.class), \"ns\");", "type": "LockedOperationBuilder", "var_name": "uut" } ]...
{ "body": "@Test\n public void testOn() {\n\n UUID id = UUID.randomUUID();\n OnBuilderStep on = uut.on(id);\n assertThat(on.ids()).hasSize(1).contains(id);\n\n UUID id2 = UUID.randomUUID();\n on = uut.on(id, id2);\n assertThat(on.ids()).hasSize(2).contains(id).contains(id2...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "ns", "modifier": "final", "original_string": "final String ns;",...
{ "body": "public OnBuilderStep on(@NonNull UUID aggId, UUID... otherAggIds) {\n LinkedList<UUID> ids = new LinkedList<>();\n ids.add(aggId);\n ids.addAll(Arrays.asList(otherAggIds));\n return new OnBuilderStep(ids);\n }", "class_method_signature": "LockedOperationBuilder.on(@NonNull ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_49
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testFromProtoMSG_ServerProperties() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_ServerProperties) null);\n });\n\n assertEquals(Maps.newHashMap(\"foo\", \"bar\"),\n uut.fromProto(MSG_ServerP...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public SubscriptionRequestTO fromProto(@NonNull MSG_SubscriptionRequest request) {\n return FactCastJson.readValue(SubscriptionRequestTO.class, request.getJson());\n }", "class_method_signature": "ProtoConverter.fromProto(@NonNull MSG_SubscriptionRequest request)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_107
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testWriteValueNull() {\n expectNPE(() -> FactCastJson.writeValueAsString(null));\n }", "class_method_signature": "FactCastJsonTest.testWriteValueNull()", "constructor": false, "full_signature": "@Test void testWriteValueNull()", "identifier": "testWriteValueNull", "invoc...
{ "fields": [ { "declarator": "objectMapper = new ObjectMapper()", "modifier": "private static final", "original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "objectMapper" }, { "declarator": "reade...
{ "body": "@SneakyThrows\n public static <T> String writeValueAsString(@NonNull T value) {\n return writer.writeValueAsString(value);\n }", "class_method_signature": "FactCastJson.writeValueAsString(@NonNull T value)", "constructor": false, "full_signature": "@SneakyThrows public static String writ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_150
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n void testNoNamespace() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n uut.publish(new TestFact().ns(null));\n });\n }", "class_method_signature": "DefaultFactCastTest.testNoNamespace()", "constructor": false, "full_signature": "@Test void ...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n public void publish(@NonNull List<? extends Fact> factsToPublish) {\n FactValidation.validate(factsToPublish);\n store.publish(factsToPublish);\n }", "class_method_signature": "DefaultFactCast.publish(@NonNull List<? extends Fact> factsToPublish)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_146
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testOfEmptyNs() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n Fact.of(\"{\\\"id\\\":\\\"\" + UUID.randomUUID() + \"\\\",\\\"ns\\\":\\\"\\\"}\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testOfEmptyNs()", "construc...
{ "fields": [ { "declarator": "jsonHeader", "modifier": "@Getter", "original_string": "@Getter\n String jsonHeader;", "type": "String", "var_name": "jsonHeader" }, { "declarator": "jsonPayload", "modifier": "@Getter", "original_string": "@Getter\n Stri...
{ "body": "public static Fact of(@NonNull String jsonHeader, @NonNull String jsonPayload) {\n return new DefaultFact(jsonHeader, jsonPayload);\n }", "class_method_signature": "DefaultFact.of(@NonNull String jsonHeader, @NonNull String jsonPayload)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_111
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testWriteValueAsPrettyString() {\n String json = \"{\\\"a\\\":1}\";\n String pretty = FactCastJson.writeValueAsPrettyString(FactCastJson.toObjectNode(json));\n assertTrue(pretty.contains(\"\\n\"));\n assertTrue(pretty.contains(\" \"));\n }", "class_method_si...
{ "fields": [ { "declarator": "objectMapper = new ObjectMapper()", "modifier": "private static final", "original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "objectMapper" }, { "declarator": "reade...
{ "body": "@SneakyThrows\n @Generated\n public static String writeValueAsPrettyString(Object o) {\n return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(o);\n }", "class_method_signature": "FactCastJson.writeValueAsPrettyString(Object o)", "constructor": false, "full_signature...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_9
{ "fields": [ { "declarator": "serial = new AtomicLong(5)", "modifier": "private", "original_string": "private AtomicLong serial = new AtomicLong(5);", "type": "AtomicLong", "var_name": "serial" }, { "declarator": "uut = new PgFactExtractor(serial)", "modifier": "...
{ "body": "@Test\n void testMapRow() throws Exception {\n\n ResultSet rs = mock(ResultSet.class);\n final UUID id = UUID.randomUUID();\n\n when(rs.getString(PgConstants.ALIAS_ID)).thenReturn(id.toString());\n when(rs.getString(PgConstants.ALIAS_NS)).thenReturn(\"ns\");\n when(rs....
{ "fields": [ { "declarator": "serial", "modifier": "final", "original_string": "final AtomicLong serial;", "type": "AtomicLong", "var_name": "serial" } ], "file": "factcast-store-pgsql/src/main/java/org/factcast/store/pgsql/internal/rowmapper/PgFactExtractor.java", "identi...
{ "body": "@Override\n @NonNull\n public Fact mapRow(@NonNull ResultSet rs, int rowNum) throws SQLException {\n serial.set(rs.getLong(PgConstants.COLUMN_SER));\n return PgFact.from(rs);\n }", "class_method_signature": "PgFactExtractor.mapRow(@NonNull ResultSet rs, int rowNum)", "constructor...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_185
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\...
{ "body": "@Test\n public void testAwaitComplete() throws Exception {\n\n observerAC.getValue().onComplete();\n\n assertTimeout(Duration.ofMillis(1000), () -> {\n // needs to return immediately\n uut.awaitComplete();\n });\n }", "class_method_signature": "Reconnectin...
{ "fields": [ { "declarator": "currentSubscription = new AtomicReference<>()", "modifier": "@NonNull\n private final", "original_string": "@NonNull\n private final AtomicReference<Subscription> currentSubscription = new AtomicReference<>();", "type": "AtomicReference<Subscription>", ...
{ "body": "@Override\n public Subscription awaitComplete() throws SubscriptionCancelledException {\n\n for (;;) {\n assertSubscriptionStateNotClosed();\n Subscription cur = currentSubscription.get();\n\n if (cur != null) {\n try {\n cur.awai...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_24
{ "fields": [ { "declarator": "uut", "modifier": "", "original_string": "PgConnectionSupplier uut;", "type": "PgConnectionSupplier", "var_name": "uut" }, { "declarator": "ds", "modifier": "@Mock\n private", "original_string": "@Mock\n private org.apach...
{ "body": "@Test\n void test_propertySyntaxBroken() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n setupConnectionProperties(\"sockettimeout:30\");\n uut.buildPgConnectionProperties(ds);\n });\n }", "class_method_signature": "PgConnectionSupplierTest....
{ "fields": [ { "declarator": "ds", "modifier": "@NonNull\n @VisibleForTesting\n protected final", "original_string": "@NonNull\n @VisibleForTesting\n protected final org.apache.tomcat.jdbc.pool.DataSource ds;", "type": "org.apache.tomcat.jdbc.pool.DataSource", "var_name"...
{ "body": "@VisibleForTesting\n Properties buildPgConnectionProperties(org.apache.tomcat.jdbc.pool.DataSource ds) {\n Properties dbp = new Properties();\n final PoolConfiguration poolProperties = ds.getPoolProperties();\n if (poolProperties != null) {\n setProperty(dbp, \"user\", po...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_73
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testPublishNullParameter() {\n assertThrows(NullPointerException.class, () -> uut.publish(null));\n }", "class_method_signature": "GrpcFactStoreTest.testPublishNullParameter()", "constructor": false, "full_signature": "@Test void testPublishNullParameter()", "identifier": ...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public void publish(@NonNull List<? extends Fact> factsToPublish) {\n log.trace(\"publishing {} facts to remote store\", factsToPublish.size());\n List<MSG_Fact> mf = factsToPublish.stream()\n .map(converter::toProto)\n .collect(Collectors\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_214
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testPublishThrows() throws Exception {\n doThrow(UnsupportedOperationException.class).when(backend).publish(anyListOf(Fact.class));\n List<Fact> toPublish = Lists.newArrayList(Fact.builder().build(\"{}\"));\n StreamObserver so = mock(StreamObserver.class);\n\n ...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n @Secured(FactCastRole.WRITE)\n public void publish(@NonNull MSG_Facts request,\n StreamObserver<MSG_Empty> responseObserver) {\n List<Fact> facts = request.getFactList()\n .stream()\n .map(converter::fromProto)\n .collect(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_65
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnCatchup() {\n uut.onNext(converter.createCatchupNotification());\n verify(factObserver).onCatchup();\n }", "class_method_signature": "ClientStreamObserverTest.testOnCatchup()", "constructor": false, "full_signature": "@Test void testOnCatchup()", "identifier":...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onNext(MSG_Notification f) {\n log.trace(\"observer got msg: {}\", f);\n switch (f.getType()) {\n case Catchup:\n log.debug(\"received onCatchup signal\");\n subscription.notifyCatchup();\n break;\n case Complete:\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_202
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n void testPublishNone() {\n doNothing().when(backend).publish(acFactList.capture());\n MSG_Facts r = MSG_Facts.newBuilder().build();\n uut.publish(r, mock(StreamObserver.class));\n verify(backend).publish(anyList());\n assertTrue(acFactList.getValue().isEmpty())...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n @Secured(FactCastRole.WRITE)\n public void publish(@NonNull MSG_Facts request,\n StreamObserver<MSG_Empty> responseObserver) {\n List<Fact> facts = request.getFactList()\n .stream()\n .map(converter::fromProto)\n .collect(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_32
{ "fields": [ { "declarator": "f = Fact.builder()\n .id(new UUID(0L, 0L))\n .ns(\"ns\")\n .aggId(new UUID(0L, 1L))\n .meta(\"foo\", \"bar\")\n .type(\"type\")\n .build(\"{\\\"some\\\":\\\"json\\\"}\")", "modifier": "", "original_s...
{ "body": "@Test\n void testRenderPretty() throws Exception {\n Options options = new Options() {\n @Override\n public boolean pretty() {\n return true;\n }\n };\n\n FactRenderer uut = new FactRenderer(options);\n assertEquals(\n ...
{ "fields": [ { "declarator": "options", "modifier": "final", "original_string": "final Options options;", "type": "Options", "var_name": "options" }, { "declarator": "TAB = \"\\t\"", "modifier": "private static final", "original_string": "private static fin...
{ "body": "public String render(Fact f) {\n return \"Fact: id=\" + f.id() + CR + TAB + \"header: \" + renderJson(f.jsonHeader()).replaceAll(\n CR, CR + TAB + TAB)\n + CR + TAB + \"payload: \" + renderJson(f.jsonPayload()).replaceAll(CR, CR + TAB\n + TAB) + C...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_193
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/SubscriptionRequestTOTest.java", "identifier": "SubscriptionRequestTOTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testHasAnyScriptFilters() {\n final FactSpec s = FactSpec.ns(\"foo\");\n SubscriptionRequest r = SubscriptionRequest.catchup(s).fromScratch();\n SubscriptionRequestTO uut = SubscriptionRequestTO.forFacts(r);\n assertFalse(uut.hasAnyScriptFilters());\n uut....
{ "fields": [ { "declarator": "maxBatchDelayInMs = 0", "modifier": "@JsonProperty", "original_string": "@JsonProperty\n long maxBatchDelayInMs = 0;", "type": "long", "var_name": "maxBatchDelayInMs" }, { "declarator": "continuous", "modifier": "@JsonProperty", ...
{ "body": "public boolean hasAnyScriptFilters() {\n return specs.stream().anyMatch(s -> s.jsFilterScript() != null);\n }", "class_method_signature": "SubscriptionRequestTO.hasAnyScriptFilters()", "constructor": false, "full_signature": "public boolean hasAnyScriptFilters()", "identifier": "hasAnyScr...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_33
{ "fields": [ { "declarator": "fs", "modifier": "@Mock", "original_string": "@Mock\n FactStore fs;", "type": "FactStore", "var_name": "fs" }, { "declarator": "fc", "modifier": "", "original_string": "FactCast fc;", "type": "FactCast", "var_nam...
{ "body": "@Test\n void testCatchup() {\n String ns = \"foo\";\n UUID startId = new UUID(0, 1);\n Catchup cmd = new Catchup(ns, startId);\n\n fc = spy(FactCast.from(fs));\n Options opt = new Options();\n\n when(fs.subscribe(any(), any(ConsoleFactObserver.class))).thenAnswe...
{ "fields": [ { "declarator": "ns", "modifier": "@Parameter(names = \"-ns\", description = \"the namespace filtered on\", required = true)", "original_string": "@Parameter(names = \"-ns\", description = \"the namespace filtered on\", required = true)\n String ns;", "type": "String", ...
{ "body": "@Override\n public void runWith(FactCast fc, Options opt) {\n ConsoleFactObserver obs = new ConsoleFactObserver(opt);\n SpecBuilder catchup = SubscriptionRequest.catchup(FactSpec.ns(ns));\n if (from == null)\n fc.subscribeEphemeral(catchup.fromScratch(), obs);\n el...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_192
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/SubscriptionRequestTOTest.java", "identifier": "SubscriptionRequestTOTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToString() {\n SubscriptionRequest r = SubscriptionRequest.catchup(FactSpec.ns(\"foo\")).fromScratch();\n String debugInfo = r.debugInfo();\n SubscriptionRequestTO uut = SubscriptionRequestTO.forFacts(r);\n assertEquals(debugInfo, uut.toString());\n }", ...
{ "fields": [ { "declarator": "maxBatchDelayInMs = 0", "modifier": "@JsonProperty", "original_string": "@JsonProperty\n long maxBatchDelayInMs = 0;", "type": "long", "var_name": "maxBatchDelayInMs" }, { "declarator": "continuous", "modifier": "@JsonProperty", ...
{ "body": "@Override\n public String toString() {\n return debugInfo;\n }", "class_method_signature": "SubscriptionRequestTO.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [], "modifiers": "@Override public",...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_203
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n void testPublishSome() {\n doNothing().when(backend).publish(acFactList.capture());\n Builder b = MSG_Facts.newBuilder();\n Fact f1 = Fact.builder().ns(\"test\").build(\"{}\");\n Fact f2 = Fact.builder().ns(\"test\").build(\"{}\");\n MSG_Fact msg1 = conv.toProt...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n @Secured(FactCastRole.WRITE)\n public void publish(@NonNull MSG_Facts request,\n StreamObserver<MSG_Empty> responseObserver) {\n List<Fact> facts = request.getFactList()\n .stream()\n .map(converter::fromProto)\n .collect(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_64
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnNextId() {\n MSG_Notification n = converter.createNotificationFor(UUID.randomUUID());\n uut.onNext(n);\n verify(factObserver).onNext(any(IdOnlyFact.class));\n }", "class_method_signature": "ClientStreamObserverTest.testOnNextId()", "constructor": false, "...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onNext(MSG_Notification f) {\n log.trace(\"observer got msg: {}\", f);\n switch (f.getType()) {\n case Catchup:\n log.debug(\"received onCatchup signal\");\n subscription.notifyCatchup();\n break;\n case Complete:\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_215
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testHandshake() throws Exception {\n\n StreamObserver so = mock(StreamObserver.class);\n uut.handshake(conv.empty(), so);\n\n verify(so).onCompleted();\n verify(so).onNext(any(MSG_ServerConfig.class));\n\n }", "class_method_signature": "FactStoreGrpcS...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void handshake(MSG_Empty request,\n StreamObserver<MSG_ServerConfig> responseObserver) {\n ServerConfig cfg = ServerConfig.of(PROTOCOL_VERSION, collectProperties());\n responseObserver.onNext(converter.toProto(cfg));\n responseObserver.onCompleted();\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_72
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testPublish() {\n when(blockingStub.publish(factsCap.capture())).thenReturn(MSG_Empty.newBuilder().build());\n final TestFact fact = new TestFact();\n uut.publish(Collections.singletonList(fact));\n verify(blockingStub).publish(any());\n final MSG_Facts pf...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public void publish(@NonNull List<? extends Fact> factsToPublish) {\n log.trace(\"publishing {} facts to remote store\", factsToPublish.size());\n List<MSG_Fact> mf = factsToPublish.stream()\n .map(converter::toProto)\n .collect(Collectors\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_184
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private GenericObserver<Fact> observer;", "type": "GenericObserver<Fact>", "var_name": "observer" }, { "declarator": "uut", "modifier": "@InjectMocks\n pr...
{ "body": "@Test\n void testOn() {\n SubscriptionImpl<Integer> on = SubscriptionImpl.on(obs);\n verify(obs, never()).onNext(any());\n on.notifyElement(1);\n verify(obs).onNext(1);\n verify(obs, never()).onCatchup();\n on.notifyCatchup();\n verify(obs).onCatchup();\n...
{ "fields": [ { "declarator": "observer", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final GenericObserver<T> observer;", "type": "GenericObserver<T>", "var_name": "observer" }, { "declarator": "onClose = () -> {\n }", "modifier": "@No...
{ "body": "public static <T> SubscriptionImpl<T> on(@NonNull GenericObserver<T> o) {\n return new SubscriptionImpl<>(o);\n }", "class_method_signature": "SubscriptionImpl.on(@NonNull GenericObserver<T> o)", "constructor": false, "full_signature": "public static SubscriptionImpl<T> on(@NonNull GenericO...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_25
{ "fields": [ { "declarator": "uut", "modifier": "", "original_string": "PgConnectionSupplier uut;", "type": "PgConnectionSupplier", "var_name": "uut" }, { "declarator": "ds", "modifier": "@Mock\n private", "original_string": "@Mock\n private org.apach...
{ "body": "@Test\n void test_nullProperties() {\n setupConnectionProperties(null);\n uut.buildPgConnectionProperties(ds);\n }", "class_method_signature": "PgConnectionSupplierTest.test_nullProperties()", "constructor": false, "full_signature": "@Test void test_nullProperties()", "identifie...
{ "fields": [ { "declarator": "ds", "modifier": "@NonNull\n @VisibleForTesting\n protected final", "original_string": "@NonNull\n @VisibleForTesting\n protected final org.apache.tomcat.jdbc.pool.DataSource ds;", "type": "org.apache.tomcat.jdbc.pool.DataSource", "var_name"...
{ "body": "@VisibleForTesting\n Properties buildPgConnectionProperties(org.apache.tomcat.jdbc.pool.DataSource ds) {\n Properties dbp = new Properties();\n final PoolConfiguration poolProperties = ds.getPoolProperties();\n if (poolProperties != null) {\n setProperty(dbp, \"user\", po...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_8
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgPostQueryMatcherTest.java", "identifier": "PgPostQueryMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPGPostQueryMatcher() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n new PgPostQueryMatcher(null);\n });\n }", "class_method_signature": "PgPostQueryMatcherTest.testPGPostQueryMatcher()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "canBeSkipped", "modifier": "@Getter\n @Accessors(fluent = true)\n final", "original_string": "@Getter\n @Accessors(fluent = true)\n final boolean canBeSkipped;", "type": "boolean", "var_name": "canBeSkipped" }, { "declarator": ...
{ "body": "PgPostQueryMatcher(@NonNull SubscriptionRequest req) {\n canBeSkipped = req.specs().stream().noneMatch(s -> s.jsFilterScript() != null);\n if (canBeSkipped) {\n log.trace(\"{} post query filtering has been disabled\", req);\n } else {\n this.matchers.addAll(req.sp...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_110
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToObjectNode() {\n ObjectNode objectNode = FactCastJson.toObjectNode(\"{\\\"x\\\":1}\");\n JsonNode jsonNode = objectNode.get(\"x\");\n assertEquals(1, jsonNode.asInt());\n assertNull(objectNode.get(\"y\"));\n }", "class_method_signature": "FactCastJsonT...
{ "fields": [ { "declarator": "objectMapper = new ObjectMapper()", "modifier": "private static final", "original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "objectMapper" }, { "declarator": "reade...
{ "body": "public static ObjectNode toObjectNode(String json) {\n try {\n return (ObjectNode) objectMapper.readTree(json);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "class_method_signature": "FactCastJson.toObjectNode(String json)", "const...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_147
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n void testSubscribeEphemeral() {\n when(store.subscribe(csr.capture(), any())).thenReturn(mock(Subscription.class));\n final UUID since = UUID.randomUUID();\n SubscriptionRequest r = SubscriptionRequest.follow(FactSpec.ns(\"foo\"))\n .or(Fac...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n @NonNull\n public Subscription subscribeEphemeral(@NonNull SubscriptionRequest req,\n @NonNull FactObserver observer) {\n return store.subscribe(SubscriptionRequestTO.forFacts(req), observer);\n }", "class_method_signature": "DefaultFactCast.subscribeEphemeral(@NonN...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_151
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n void testPublishOneNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.publish((Fact) null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testPublishOneNull()", "constructor": false, "full_signature": "@Test void testPublis...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n public void publish(@NonNull List<? extends Fact> factsToPublish) {\n FactValidation.validate(factsToPublish);\n store.publish(factsToPublish);\n }", "class_method_signature": "DefaultFactCast.publish(@NonNull List<? extends Fact> factsToPublish)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_48
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testFromProtoMSG_ServerProtocolVersion() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_ServerProtocolVersion) null);\n });\n\n assertEquals(ProtocolVersion.of(1, 2, 3),\n uut.fromProto(MSG_Ser...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public SubscriptionRequestTO fromProto(@NonNull MSG_SubscriptionRequest request) {\n return FactCastJson.readValue(SubscriptionRequestTO.class, request.getJson());\n }", "class_method_signature": "ProtoConverter.fromProto(@NonNull MSG_SubscriptionRequest request)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_106
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testReadValueFromInputStream() {\n\n X x = FactCastJson.readValue(X.class, new ByteArrayInputStream(\"{\\\"foo\\\":\\\"baz\\\",\\\"bar\\\":7}\"\n .getBytes()));\n assertThat(x.foo).isEqualTo(\"baz\");\n assertThat(x.bar).isEqualTo(7);\n }", "class_me...
{ "fields": [ { "declarator": "objectMapper = new ObjectMapper()", "modifier": "private static final", "original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "objectMapper" }, { "declarator": "reade...
{ "body": "@SneakyThrows\n public static <T> T readValue(@NonNull Class<T> class1, String json) {\n return reader.forType(class1).readValue(json);\n }", "class_method_signature": "FactCastJson.readValue(@NonNull Class<T> class1, String json)", "constructor": false, "full_signature": "@SneakyThrows ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_171
{ "fields": [ { "declarator": "uut = new LockedOperationBuilder(mock(FactStore.class), \"ns\")", "modifier": "", "original_string": "LockedOperationBuilder uut = new LockedOperationBuilder(mock(FactStore.class), \"ns\");", "type": "LockedOperationBuilder", "var_name": "uut" } ]...
{ "body": "@Test\n public void testOptimistic() throws Exception {\n UUID id = new UUID(1, 2);\n WithOptimisticLock wol = uut.on(id).optimistic();\n assertThat(wol).isNotNull();\n assertThat(wol.ns()).isEqualTo(\"ns\");\n assertThat(wol.ids().get(0)).isEqualTo(id);\n asser...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "ns", "modifier": "final", "original_string": "final String ns;",...
{ "body": "public OnBuilderStep on(@NonNull UUID aggId, UUID... otherAggIds) {\n LinkedList<UUID> ids = new LinkedList<>();\n ids.add(aggId);\n ids.addAll(Arrays.asList(otherAggIds));\n return new OnBuilderStep(ids);\n }", "class_method_signature": "LockedOperationBuilder.on(@NonNull ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_126
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMatchesNull() throws Exception {\n TestHelper.expectNPE(() -> {\n FactSpecMatcher.matches(null);\n });\n }", "class_method_signature": "FactSpecMatcherTest.testMatchesNull()", "constructor": false, "full_signature": "@Test public void testMatches...
{ "fields": [ { "declarator": "scriptEngineCache = new LRUMap<>(10,\n 200)", "modifier": "private static final", "original_string": "private static final LRUMap<FilterScript, ScriptEngine> scriptEngineCache = new LRUMap<>(10,\n 200);", "type": "LRUMap<FilterScript, Sc...
{ "body": "public static Predicate<Fact> matches(@NonNull FactSpec spec) {\n return new FactSpecMatcher(spec);\n }", "class_method_signature": "FactSpecMatcher.matches(@NonNull FactSpec spec)", "constructor": false, "full_signature": "public static Predicate<Fact> matches(@NonNull FactSpec spec)", "...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_87
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testSubscribeNull() {\n expectNPE(() -> uut.subscribe(null, mock(FactObserver.class)));\n expectNPE(() -> uut.subscribe(null, null));\n expectNPE(() -> uut.subscribe(mock(SubscriptionRequestTO.class), null));\n }", "class_method_signature": "GrpcFactStoreTest.testS...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public Subscription subscribe(@NonNull SubscriptionRequestTO req,\n @NonNull FactObserver observer) {\n SubscriptionImpl<Fact> subscription = SubscriptionImpl.on(observer);\n StreamObserver<FactStoreProto.MSG_Notification> responseObserver = new ClientStreamObserver(...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_68
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnTransportComplete() {\n uut.onCompleted();\n verify(factObserver).onComplete();\n }", "class_method_signature": "ClientStreamObserverTest.testOnTransportComplete()", "constructor": false, "full_signature": "@Test void testOnTransportComplete()", "identifier": ...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onCompleted() {\n subscription.notifyComplete();\n }", "class_method_signature": "ClientStreamObserver.onCompleted()", "constructor": false, "full_signature": "@Override public void onCompleted()", "identifier": "onCompleted", "invocations": [ "notifyCompl...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_91
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testWrapRetryable_nonRetryable() throws Exception {\n StatusRuntimeException cause = new StatusRuntimeException(Status.DEADLINE_EXCEEDED);\n RuntimeException e = GrpcFactStore.wrapRetryable(cause);\n assertTrue(e instanceof StatusRuntimeException);\n assertSame(e...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@VisibleForTesting\n static RuntimeException wrapRetryable(StatusRuntimeException e) {\n if (e.getStatus().getCode() == Code.UNAVAILABLE) {\n return new RetryableException(e);\n } else {\n return e;\n }\n }", "class_method_signature": "GrpcFactStore.wrapRe...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_130
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/IdOnlyFactTest.java", "identifier": "IdOnlyFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testJsonHeader() {\n Assertions.assertThrows(UnsupportedOperationException.class, () -> {\n new IdOnlyFact(UUID.randomUUID()).jsonHeader();\n });\n }", "class_method_signature": "IdOnlyFactTest.testJsonHeader()", "constructor": false, "full_signature": "@Te...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" } ], "file": "factcast-core/src/main/java/org/factcast/core/IdOnlyFact.java", "identifier": "...
{ "body": "@Override\n public String jsonHeader() {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "IdOnlyFact.jsonHeader()", "constructor": false, "full_signature": "@Override public String jsonHeader()", "identifier": "jsonHeader", "invocations": [], "modifiers...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_219
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testPublishConditional() throws Exception {\n {\n UUID id = UUID.randomUUID();\n\n ConditionalPublishRequest sfr = new ConditionalPublishRequest(Lists.newArrayList(), id);\n MSG_ConditionalPublishRequest req = conv.toProto(sfr);\n St...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n @Secured(FactCastRole.WRITE)\n public void publishConditional(MSG_ConditionalPublishRequest request,\n StreamObserver<MSG_ConditionalPublishResult> responseObserver) {\n try {\n ConditionalPublishRequest req = converter.fromProto(request);\n boolean...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_167
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/store/StateTokenTest.java", "identifier": "StateTokenTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStateToken() throws Exception {\n assertThat(new StateToken().uuid()).isNotNull();\n }", "class_method_signature": "StateTokenTest.testStateToken()", "constructor": false, "full_signature": "@Test public void testStateToken()", "identifier": "testStateToken", ...
{ "fields": [ { "declarator": "uuid", "modifier": "", "original_string": "UUID uuid;", "type": "UUID", "var_name": "uuid" } ], "file": "factcast-core/src/main/java/org/factcast/core/store/StateToken.java", "identifier": "StateToken", "interfaces": "", "methods": [ {...
{ "body": "public StateToken() {\n this(UUID.randomUUID());\n }", "class_method_signature": "StateToken.StateToken()", "constructor": true, "full_signature": "public StateToken()", "identifier": "StateToken", "invocations": [], "modifiers": "public", "parameters": "()", "return": "", "sig...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_29
{ "fields": [ { "declarator": "env", "modifier": "@Mock", "original_string": "@Mock\n Environment env;", "type": "Environment", "var_name": "env" }, { "declarator": "uut", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n RdsDataSourceFact...
{ "body": "@Test\n public void shouldReplaceJdbcCP() throws Exception {\n AmazonRdsDataSourceFactoryBean instance = mock(AmazonRdsDataSourceFactoryBean.class);\n when(env.getProperty(any(), any(), anyBoolean())).thenReturn(true);\n\n AmazonRdsDataSourceFactoryBean afterInit = (AmazonRdsDataSou...
{ "fields": [ { "declarator": "env", "modifier": "@NonNull\n private final", "original_string": "@NonNull\n private final Environment env;", "type": "Environment", "var_name": "env" } ], "file": "factcast-store-pgsql-rds/src/main/java/org/factcast/store/pgsql/rds/RdsDat...
{ "body": "@Override\n @NonNull\n public Object postProcessBeforeInitialization(@NonNull Object bean, @NonNull String beanName)\n throws BeansException {\n if (bean instanceof AmazonRdsDataSourceFactoryBean) {\n ((AmazonRdsDataSourceFactoryBean) bean).setDataSourceFactory(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_188
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "req", "modifier": "@Mock\n private", "original_string": "@Mock\...
{ "body": "@Test\n public void testAwaitCatchupLong() throws Exception {\n when(subscription.awaitCatchup(anyLong())).thenThrow(TimeoutException.class)\n .then(x -> subscription);\n\n assertThrows(TimeoutException.class, () -> {\n uut.awaitCatchup(51);\n });\n\n ...
{ "fields": [ { "declarator": "currentSubscription = new AtomicReference<>()", "modifier": "@NonNull\n private final", "original_string": "@NonNull\n private final AtomicReference<Subscription> currentSubscription = new AtomicReference<>();", "type": "AtomicReference<Subscription>", ...
{ "body": "@Override\n public Subscription awaitCatchup() throws SubscriptionCancelledException {\n\n for (;;) {\n assertSubscriptionStateNotClosed();\n Subscription cur = currentSubscription.get();\n if (cur != null) {\n try {\n cur.awaitCa...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_52
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testFromProtoMSG_StateForRequest_emptyAggIds() throws Exception {\n\n MSG_StateForRequest request = MSG_StateForRequest.newBuilder().setNsPresent(false).build();\n StateForRequest req = uut.fromProto(request);\n assertNotNull(req.aggIds());\n assertEquals(...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public SubscriptionRequestTO fromProto(@NonNull MSG_SubscriptionRequest request) {\n return FactCastJson.readValue(SubscriptionRequestTO.class, request.getJson());\n }", "class_method_signature": "ProtoConverter.fromProto(@NonNull MSG_SubscriptionRequest request)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_4
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/query/PgQueryBuilderTest.java", "identifier": "PgQueryBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPGQueryBuilder() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n new PgQueryBuilder(null);\n });\n\n PgQueryBuilder uut = new PgQueryBuilder(mock(SubscriptionRequestTO.class));\n assertThrows(NullPointerException.clas...
{ "fields": [ { "declarator": "selectIdOnly", "modifier": "final", "original_string": "final boolean selectIdOnly;", "type": "boolean", "var_name": "selectIdOnly" }, { "declarator": "req", "modifier": "@NonNull\n final", "original_string": "@NonNull\n ...
{ "body": "public PgQueryBuilder(@NonNull SubscriptionRequestTO request) {\n this.req = request;\n selectIdOnly = request.idOnly() && !request.hasAnyScriptFilters();\n }", "class_method_signature": "PgQueryBuilder.PgQueryBuilder(@NonNull SubscriptionRequestTO request)", "constructor": true, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_13
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactTest.java", "identifier": "PgFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testFrom() throws Exception {\n ResultSet rs = mock(ResultSet.class);\n when(rs.next()).thenReturn(true);\n String ns = \"ns\";\n String type = \"type\";\n String aggId = UUID.randomUUID().toString();\n String aggIdArr = \"[\\\"\" + aggId + \"\\\"]\...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" }, { "declarator": "ns", "modifier": "@Getter\n @NonNull\n final", "ori...
{ "body": "@SneakyThrows\n @Generated\n public static Fact from(ResultSet resultSet) {\n String id = resultSet.getString(PgConstants.ALIAS_ID);\n String aggId = resultSet.getString(PgConstants.ALIAS_AGGID);\n String type = resultSet.getString(PgConstants.ALIAS_TYPE);\n String ns = re...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_44
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testToProtoSubscriptionRequestNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.toProto((SubscriptionRequestTO) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testToProtoSubscriptionRequestNull()", "constructor": f...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_223
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private StreamObserver<MSG_Notification> observer;", "type": "StreamObserver<MSG_Notification>", "var_name": "observer" }, { "declarator": "projection", "mod...
{ "body": "@Test\n void testOnCompleteWithException() {\n GrpcObserverAdapter uut = new GrpcObserverAdapter(\"foo\", observer, projection);\n doThrow(UnsupportedOperationException.class).when(observer).onCompleted();\n uut.onComplete();\n verify(observer).onCompleted();\n }", "clas...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "id", "modifier": "@NonNull\n ...
{ "body": "@Override\n public void onComplete() {\n log.info(\"{} onComplete – sending complete notification\", id);\n observer.onNext(converter.createCompleteNotification());\n tryComplete();\n }", "class_method_signature": "GrpcObserverAdapter.onComplete()", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_101
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n public void testCurrentTime() throws Exception {\n long l = 123L;\n when(blockingStub.currentTime(conv.empty())).thenReturn(conv.toProto(l));\n Long t = uut.currentTime();\n assertEquals(t, l);\n }", "class_method_signature": "GrpcFactStoreTest.testCurrentTime()"...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public long currentTime() {\n\n MSG_Empty empty = converter.empty();\n MSG_CurrentDatabaseTime resp;\n try {\n resp = blockingStub.currentTime(empty);\n } catch (StatusRuntimeException e) {\n throw wrapRetryable(e);\n }\n return...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_18
{ "fields": [ { "declarator": "mockTimer", "modifier": "@Mock", "original_string": "@Mock\n Timer mockTimer;", "type": "Timer", "var_name": "mockTimer" }, { "declarator": "callback", "modifier": "@Mock", "original_string": "@Mock\n PgSynchronizedQuery ...
{ "body": "@Test\n void testDelayedExecution() {\n CondensedQueryExecutor uut = new CondensedQueryExecutor(1, callback, () -> true, mockTimer);\n uut.trigger();\n verify(mockTimer).schedule(any(), eq(1L));\n task.getValue().run();\n verify(callback).run(anyBoolean());\n }", ...
{ "fields": [ { "declarator": "maxDelayInMillis", "modifier": "final", "original_string": "final long maxDelayInMillis;", "type": "long", "var_name": "maxDelayInMillis" }, { "declarator": "target", "modifier": "final", "original_string": "final PgSynchronize...
{ "body": "public void trigger() {\n if (connectionStateSupplier.get()) {\n if (maxDelayInMillis < 1) {\n runTarget();\n } else if (!currentlyScheduled.getAndSet(true)) {\n timer.schedule(new TimerTask() {\n\n @Override\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_156
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n void testSubscribeFacts2ndArgNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.subscribeEphemeral(SubscriptionRequest.follow(FactSpec.ns(\"foo\")).fromScratch(),\n null);\n });\n }", "class_method_signature": "DefaultFac...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n @NonNull\n public Subscription subscribeEphemeral(@NonNull SubscriptionRequest req,\n @NonNull FactObserver observer) {\n return store.subscribe(SubscriptionRequestTO.forFacts(req), observer);\n }", "class_method_signature": "DefaultFactCast.subscribeEphemeral(@NonN...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_140
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testExternalization() throws Exception {\n Fact f = DefaultFact.of(\"{\\\"id\\\":\\\"\" + UUID.randomUUID()\n + \"\\\",\\\"ns\\\":\\\"default\\\",\\\"meta\\\":{\\\"foo\\\":7}}\", \"{}\");\n Fact copy = copyBySerialization(f);\n assertEquals(f, copy);\n ...
{ "fields": [ { "declarator": "jsonHeader", "modifier": "@Getter", "original_string": "@Getter\n String jsonHeader;", "type": "String", "var_name": "jsonHeader" }, { "declarator": "jsonPayload", "modifier": "@Getter", "original_string": "@Getter\n Stri...
{ "body": "public static Fact of(@NonNull String jsonHeader, @NonNull String jsonPayload) {\n return new DefaultFact(jsonHeader, jsonPayload);\n }", "class_method_signature": "DefaultFact.of(@NonNull String jsonHeader, @NonNull String jsonPayload)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_59
{ "fields": [], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtocolVersionTest.java", "identifier": "ProtocolVersionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToString() {\n assertEquals(\"3.1.2\", ProtocolVersion.of(3, 1, 2).toString());\n }", "class_method_signature": "ProtocolVersionTest.testToString()", "constructor": false, "full_signature": "@Test void testToString()", "identifier": "testToString", "invocations": [ ...
{ "fields": [ { "declarator": "major", "modifier": "final", "original_string": "final int major;", "type": "int", "var_name": "major" }, { "declarator": "minor", "modifier": "final", "original_string": "final int minor;", "type": "int", "var_name...
{ "body": "@Override\n public String toString() {\n StringJoiner joiner = new StringJoiner(\".\");\n joiner.add(String.valueOf(major)).add(String.valueOf(minor)).add(String.valueOf(patch));\n return joiner.toString();\n }", "class_method_signature": "ProtocolVersion.toString()", "constr...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_117
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecTest.java", "identifier": "FactSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testFactSpecEquality() {\n FactSpec f1 = FactSpec.ns(\"x\");\n FactSpec f2 = FactSpec.ns(\"x\");\n assertEquals(f1, f2);\n assertNotSame(f1, f2);\n }", "class_method_signature": "FactSpecTest.testFactSpecEquality()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "ns", "modifier": "@NonNull\n @JsonProperty\n final", "original_string": "@NonNull\n @JsonProperty\n final String ns;", "type": "String", "var_name": "ns" }, { "declarator": "type = null", "modifier": "@JsonProperty", ...
{ "body": "public static FactSpec ns(String ns) {\n return new FactSpec(ns);\n }", "class_method_signature": "FactSpec.ns(String ns)", "constructor": false, "full_signature": "public static FactSpec ns(String ns)", "identifier": "ns", "invocations": [], "modifiers": "public static", "parameter...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_22
{ "fields": [ { "declarator": "ds", "modifier": "@Mock", "original_string": "@Mock\n PgConnectionSupplier ds;", "type": "PgConnectionSupplier", "var_name": "ds" }, { "declarator": "bus", "modifier": "@Mock", "original_string": "@Mock\n AsyncEventBus bu...
{ "body": "@Test\n void testStopWithoutStarting() {\n PgListener l = new PgListener(ds, bus, tester);\n l.destroy();\n verifyNoMoreInteractions(conn);\n }", "class_method_signature": "PgListenerTest.testStopWithoutStarting()", "constructor": false, "full_signature": "@Test void testSt...
{ "fields": [ { "declarator": "pgConnectionSupplier", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final PgConnectionSupplier pgConnectionSupplier;", "type": "PgConnectionSupplier", "var_name": "pgConnectionSupplier" }, { "declarator": "eventBus"...
{ "body": "@Override\n public void destroy() {\n this.running.set(false);\n if (listenerThread != null) {\n listenerThread.interrupt();\n }\n }", "class_method_signature": "PgListener.destroy()", "constructor": false, "full_signature": "@Override public void destroy()", "...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_183
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private GenericObserver<Fact> observer;", "type": "GenericObserver<Fact>", "var_name": "observer" }, { "declarator": "uut", "modifier": "@InjectMocks\n pr...
{ "body": "@Test\n void testOnNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n SubscriptionImpl.on(null);\n });\n }", "class_method_signature": "SubscriptionImplTest.testOnNull()", "constructor": false, "full_signature": "@Test void testOnNull()", "identi...
{ "fields": [ { "declarator": "observer", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final GenericObserver<T> observer;", "type": "GenericObserver<T>", "var_name": "observer" }, { "declarator": "onClose = () -> {\n }", "modifier": "@No...
{ "body": "public static <T> SubscriptionImpl<T> on(@NonNull GenericObserver<T> o) {\n return new SubscriptionImpl<>(o);\n }", "class_method_signature": "SubscriptionImpl.on(@NonNull GenericObserver<T> o)", "constructor": false, "full_signature": "public static SubscriptionImpl<T> on(@NonNull GenericO...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_75
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void configureCompressionSkipCompression() {\n uut.configureCompression(\"zip,lz3,lz4, lz99\");\n verifyNoMoreInteractions(stub);\n }", "class_method_signature": "GrpcFactStoreTest.configureCompressionSkipCompression()", "constructor": false, "full_signature": "@Test void ...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@VisibleForTesting\n void configureCompression(String codecListFromServer) {\n codecs.selectFrom(codecListFromServer).ifPresent(c -> {\n log.info(\"configuring Codec \" + c);\n this.blockingStub = blockingStub.withCompression(c);\n this.stub = stub.withCompression...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_212
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testEnumerateTypesThrows() throws Exception {\n uut = new FactStoreGrpcService(backend);\n StreamObserver so = mock(StreamObserver.class);\n when(backend.enumerateTypes(eq(\"ns\"))).thenThrow(UnsupportedOperationException.class);\n\n uut.enumerateTypes(con...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void enumerateTypes(MSG_String request,\n StreamObserver<MSG_StringSet> responseObserver) {\n\n enableResponseCompression(responseObserver);\n\n try {\n Set<String> types = store.enumerateTypes(converter.fromProto(\n request));\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_63
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnNextFailsOnUnknownMessage() {\n assertThrows(IllegalArgumentException.class, () -> {\n MSG_Notification n = MSG_Notification.newBuilder().setType(Type.UNRECOGNIZED).build();\n uut.onNext(n);\n });\n }", "class_method_signature": "ClientStreamOb...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onNext(MSG_Notification f) {\n log.trace(\"observer got msg: {}\", f);\n switch (f.getType()) {\n case Catchup:\n log.debug(\"received onCatchup signal\");\n subscription.notifyCatchup();\n break;\n case Complete:\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_204
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n void testFetchById() {\n UUID id = UUID.randomUUID();\n uut.fetchById(conv.toProto(id), mock(ServerCallStreamObserver.class));\n verify(backend).fetchById(eq(id));\n }", "class_method_signature": "FactStoreGrpcServiceTest.testFetchById()", "constructor": false, "ful...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void fetchById(MSG_UUID request,\n StreamObserver<MSG_OptionalFact> responseObserver) {\n try {\n enableResponseCompression(responseObserver);\n\n UUID fromProto = converter.fromProto(request);\n log.trace(\"fetchById {}\", fromProto)...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_195
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/SubscriptionRequestTOTest.java", "identifier": "SubscriptionRequestTOTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testAddSpecs() {\n final FactSpec s = FactSpec.ns(\"foo\");\n SubscriptionRequest r = SubscriptionRequest.catchup(s).fromScratch();\n SubscriptionRequestTO uut = SubscriptionRequestTO.forFacts(r);\n assertEquals(1, uut.specs().size());\n final String js = ...
{ "fields": [ { "declarator": "maxBatchDelayInMs = 0", "modifier": "@JsonProperty", "original_string": "@JsonProperty\n long maxBatchDelayInMs = 0;", "type": "long", "var_name": "maxBatchDelayInMs" }, { "declarator": "continuous", "modifier": "@JsonProperty", ...
{ "body": "public void addSpecs(@NonNull List<FactSpec> factSpecs) {\n checkArgument(!factSpecs.isEmpty());\n specs.addAll(factSpecs);\n }", "class_method_signature": "SubscriptionRequestTO.addSpecs(@NonNull List<FactSpec> factSpecs)", "constructor": false, "full_signature": "public void addSpe...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_34
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testToProtoUUIDNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.toProto((UUID) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testToProtoUUIDNull()", "constructor": false, "full_signature": "@Test void testToPro...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_224
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private StreamObserver<MSG_Notification> observer;", "type": "StreamObserver<MSG_Notification>", "var_name": "observer" }, { "declarator": "projection", "mod...
{ "body": "@Test\n void testOnCatchup() {\n GrpcObserverAdapter uut = new GrpcObserverAdapter(\"foo\", observer, projection);\n doNothing().when(observer).onNext(msg.capture());\n verify(observer, never()).onNext(any());\n uut.onCatchup();\n verify(observer).onNext(any());\n ...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "id", "modifier": "@NonNull\n ...
{ "body": "@Override\n public void onCatchup() {\n log.info(\"{} onCatchup – sending catchup notification\", id);\n observer.onNext(converter.createCatchupNotification());\n }", "class_method_signature": "GrpcObserverAdapter.onCatchup()", "constructor": false, "full_signature": "@Override pu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_43
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testFromProtoMSG_SubscriptionRequestNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_SubscriptionRequest) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testFromProtoMSG_SubscriptionRequestNull()", ...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public SubscriptionRequestTO fromProto(@NonNull MSG_SubscriptionRequest request) {\n return FactCastJson.readValue(SubscriptionRequestTO.class, request.getJson());\n }", "class_method_signature": "ProtoConverter.fromProto(@NonNull MSG_SubscriptionRequest request)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_14
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactTest.java", "identifier": "PgFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToUUIDArrayNull() {\n Set<UUID> res = PgFact.toUUIDArray(null);\n assertTrue(res.isEmpty());\n }", "class_method_signature": "PgFactTest.testToUUIDArrayNull()", "constructor": false, "full_signature": "@Test void testToUUIDArrayNull()", "identifier": "testToUUID...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" }, { "declarator": "ns", "modifier": "@Getter\n @NonNull\n final", "ori...
{ "body": "@VisibleForTesting\n static Set<UUID> toUUIDArray(String aggIdArrayAsString) {\n Set<UUID> set = new LinkedHashSet<>();\n if (aggIdArrayAsString != null && aggIdArrayAsString.trim().length() > 2) {\n UUID[] readValue = FactCastJson.readValue(UUID[].class, aggIdArrayAsString);\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_3
{ "fields": [ { "declarator": "uut = new PgConfigurationProperties()", "modifier": "private", "original_string": "private PgConfigurationProperties uut = new PgConfigurationProperties();", "type": "PgConfigurationProperties", "var_name": "uut" } ], "file": "factcast-store-pgs...
{ "body": "@Test\n void testGetFetchSize() {\n assertEquals(250, uut.getFetchSize());\n }", "class_method_signature": "PgConfigurationPropertiesTest.testGetFetchSize()", "constructor": false, "full_signature": "@Test void testGetFetchSize()", "identifier": "testGetFetchSize", "invocations": [ ...
{ "fields": [ { "declarator": "LEGACY_PREFIX = \"factcast.pg\"", "modifier": "private static final", "original_string": "private static final String LEGACY_PREFIX = \"factcast.pg\";", "type": "String", "var_name": "LEGACY_PREFIX" }, { "declarator": "env", "modifie...
{ "body": "public int getFetchSize() {\n return getQueueSize() / queueFetchRatio;\n }", "class_method_signature": "PgConfigurationProperties.getFetchSize()", "constructor": false, "full_signature": "public int getFetchSize()", "identifier": "getFetchSize", "invocations": [ "getQueueSize" ], ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_55
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testToProtoStateForRequest() throws Exception {\n\n assertThrows(NullPointerException.class, () -> {\n uut.toProto((StateForRequest) null);\n });\n\n StateForRequest req = new StateForRequest(Lists.emptyList(), null);\n MSG_StateForRequest msg =...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_160
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n public void testEnumerateTypesNullContract() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n FactCast.from(store).enumerateTypes(null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testEnumerateTypesNullContract()", "construct...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n public Set<String> enumerateTypes(@NonNull String ns) {\n return store.enumerateTypes(ns);\n }", "class_method_signature": "DefaultFactCast.enumerateTypes(@NonNull String ns)", "constructor": false, "full_signature": "@Override public Set<String> enumerateTypes(@NonNull Strin...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_137
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNoId() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n DefaultFact.of(\"{\\\"ns\\\":\\\"default\\\"}\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testNoId()", "constructor": false, "full_signature": "@Test voi...
{ "fields": [ { "declarator": "jsonHeader", "modifier": "@Getter", "original_string": "@Getter\n String jsonHeader;", "type": "String", "var_name": "jsonHeader" }, { "declarator": "jsonPayload", "modifier": "@Getter", "original_string": "@Getter\n Stri...
{ "body": "public static Fact of(@NonNull String jsonHeader, @NonNull String jsonPayload) {\n return new DefaultFact(jsonHeader, jsonPayload);\n }", "class_method_signature": "DefaultFact.of(@NonNull String jsonHeader, @NonNull String jsonPayload)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_96
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testSerialOfNullParameters() throws Exception {\n expectNPE(() -> uut.serialOf(null));\n }", "class_method_signature": "GrpcFactStoreTest.testSerialOfNullParameters()", "constructor": false, "full_signature": "@Test void testSerialOfNullParameters()", "identifier": "testSe...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public OptionalLong serialOf(@NonNull UUID l) {\n MSG_UUID protoMessage = converter.toProto(l);\n MSG_OptionalSerial responseMessage;\n try {\n responseMessage = blockingStub.serialOf(protoMessage);\n } catch (StatusRuntimeException e) {\n th...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_79
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n void testCancelNotRetryableExceptionOnUnavailableStatus() {\n ClientCall<MSG_SubscriptionRequest, MSG_Notification> call = mock(ClientCall.class);\n doThrow(new StatusRuntimeException(Status.UNAVAILABLE)).when(call).cancel(any(), any());\n ...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@VisibleForTesting\n void cancel(final ClientCall<MSG_SubscriptionRequest, MSG_Notification> call) {\n // cancel does not need to be retried.\n call.cancel(\"Client is no longer interested\", null);\n }", "class_method_signature": "GrpcFactStore.cancel(final ClientCall<MSG_Subscriptio...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_208
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testSerialOfThrows() throws Exception {\n uut = new FactStoreGrpcService(backend);\n\n StreamObserver so = mock(StreamObserver.class);\n when(backend.serialOf(any(UUID.class))).thenThrow(UnsupportedOperationException.class);\n\n assertThrows(UnsupportedOpe...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void serialOf(MSG_UUID request, StreamObserver<MSG_OptionalSerial> responseObserver) {\n OptionalLong serialOf = store.serialOf(converter.fromProto(request));\n responseObserver.onNext(converter.toProto(serialOf));\n responseObserver.onCompleted();\n }", "cla...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_80
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testSerialOfPropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.serialOf(any())).thenThrow(new StatusRuntimeException(\n Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.serialOf(mock(UUID.class)));\n }", "class_m...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public OptionalLong serialOf(@NonNull UUID l) {\n MSG_UUID protoMessage = converter.toProto(l);\n MSG_OptionalSerial responseMessage;\n try {\n responseMessage = blockingStub.serialOf(protoMessage);\n } catch (StatusRuntimeException e) {\n th...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_121
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testTypeMatch() {\n assertTrue(typeMatch(FactSpec.ns(\"default\").type(\"a\"), new TestFact().type(\"a\")));\n assertTrue(typeMatch(FactSpec.ns(\"default\"), new TestFact().type(\"a\")));\n assertFalse(typeMatch(FactSpec.ns(\"default\").type(\"a\"), new TestFact().type(...
{ "fields": [ { "declarator": "scriptEngineCache = new LRUMap<>(10,\n 200)", "modifier": "private static final", "original_string": "private static final LRUMap<FilterScript, ScriptEngine> scriptEngineCache = new LRUMap<>(10,\n 200);", "type": "LRUMap<FilterScript, Sc...
{ "body": "protected boolean typeMatch(Fact t) {\n if (type == null) {\n return true;\n }\n String otherType = t.type();\n return type.equals(otherType);\n }", "class_method_signature": "FactSpecMatcher.typeMatch(Fact t)", "constructor": false, "full_signature": "protec...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_176
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/lock/WithOptimisticLockTest.java", "identifier": "WithOptimisticLockTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void attemptReturnsNullShouldBeAnAbort() {\n\n WithOptimisticLock uut\n = new WithOptimisticLock(Mockito.mock(FactStore.class), null, Collections.singletonList(UUID.randomUUID()));\n\n\n Assertions.assertThrows(AttemptAbortedException.class,\n () -> {\...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n @Getter(value = AccessLevel.PROTECTED)\n private final", "original_string": "@NonNull\n @Getter(value = AccessLevel.PROTECTED)\n private final FactStore store;", "type": "FactStore", "var_name": "store" },...
{ "body": "@NonNull\n public PublishingResult attempt(@NonNull Attempt operation) throws AttemptAbortedException,\n OptimisticRetriesExceededException,\n ExceptionAfterPublish {\n while (++count <= retry) {\n\n // fetch current state\n StateToken token = store.sta...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_38
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testToProtoFacts_nullArg() {\n assertThrows(NullPointerException.class, () -> {\n uut.toProto((List<Fact>) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testToProtoFacts_nullArg()", "constructor": false, "full_signature": "@Test void test...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_199
{ "fields": [ { "declarator": "delegate", "modifier": "@Mock\n private", "original_string": "@Mock\n private ServerCallStreamObserver<Object> delegate;", "type": "ServerCallStreamObserver<Object>", "var_name": "delegate" }, { "declarator": "uut", "modifier":...
{ "body": "@Test\n void testOnError() {\n verify(delegate, never()).onError(any());\n uut.onError(new Exception());\n verify(delegate).onError(any());\n }", "class_method_signature": "BlockingStreamObserverTest.testOnError()", "constructor": false, "full_signature": "@Test void testOn...
{ "fields": [ { "declarator": "RETRY_COUNT = 60", "modifier": "private static final", "original_string": "private static final int RETRY_COUNT = 60;", "type": "int", "var_name": "RETRY_COUNT" }, { "declarator": "WAIT_TIME = 1000", "modifier": "private static final...
{ "body": "@Override\n public void onError(Throwable t) {\n delegate.onError(t);\n }", "class_method_signature": "BlockingStreamObserver.onError(Throwable t)", "constructor": false, "full_signature": "@Override public void onError(Throwable t)", "identifier": "onError", "invocations": [ "on...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_177
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private GenericObserver<Fact> observer;", "type": "GenericObserver<Fact>", "var_name": "observer" }, { "declarator": "uut", "modifier": "@InjectMocks\n pr...
{ "body": "@Test\n void testClose() throws Exception {\n expect(TimeoutException.class, () -> uut.awaitCatchup(10));\n expect(TimeoutException.class, () -> uut.awaitComplete(10));\n uut.close();\n expect(SubscriptionCancelledException.class, () -> uut.awaitCatchup(10));\n expect(...
{ "fields": [ { "declarator": "observer", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final GenericObserver<T> observer;", "type": "GenericObserver<T>", "var_name": "observer" }, { "declarator": "onClose = () -> {\n }", "modifier": "@No...
{ "body": "@Override\n public void close() {\n if (!closed.getAndSet(true)) {\n SubscriptionCancelledException closedException = new SubscriptionCancelledException(\n \"Client closed the subscription\");\n catchup.completeExceptionally(closedException);\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_39
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testCreateCatchupNotification() {\n MSG_Notification n = uut.createCatchupNotification();\n assertNotNull(n);\n assertEquals(MSG_Notification.Type.Catchup, n.getType());\n }", "class_method_signature": "ProtoConverterTest.testCreateCatchupNotification()", "constr...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public MSG_Notification createCatchupNotification() {\n return MSG_Notification.newBuilder().setType(MSG_Notification.Type.Catchup).build();\n }", "class_method_signature": "ProtoConverter.createCatchupNotification()", "constructor": false, "full_signature": "public MSG_Notification createC...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_198
{ "fields": [ { "declarator": "delegate", "modifier": "@Mock\n private", "original_string": "@Mock\n private ServerCallStreamObserver<Object> delegate;", "type": "ServerCallStreamObserver<Object>", "var_name": "delegate" }, { "declarator": "uut", "modifier":...
{ "body": "@Test\n void testOnCompleted() {\n verify(delegate, never()).onCompleted();\n uut.onCompleted();\n verify(delegate).onCompleted();\n }", "class_method_signature": "BlockingStreamObserverTest.testOnCompleted()", "constructor": false, "full_signature": "@Test void testOnCompl...
{ "fields": [ { "declarator": "RETRY_COUNT = 60", "modifier": "private static final", "original_string": "private static final int RETRY_COUNT = 60;", "type": "int", "var_name": "RETRY_COUNT" }, { "declarator": "WAIT_TIME = 1000", "modifier": "private static final...
{ "body": "@Override\n public void onCompleted() {\n delegate.onCompleted();\n }", "class_method_signature": "BlockingStreamObserver.onCompleted()", "constructor": false, "full_signature": "@Override public void onCompleted()", "identifier": "onCompleted", "invocations": [ "onCompleted" ]...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_81
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testSerialOf() {\n OptionalLong seven = OptionalLong.of(7);\n when(blockingStub.serialOf(any())).thenReturn(conv.toProto(seven));\n\n OptionalLong response = uut.serialOf(mock(UUID.class));\n\n assertEquals(seven, response);\n assertNotSame(seven, response...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public OptionalLong serialOf(@NonNull UUID l) {\n MSG_UUID protoMessage = converter.toProto(l);\n MSG_OptionalSerial responseMessage;\n try {\n responseMessage = blockingStub.serialOf(protoMessage);\n } catch (StatusRuntimeException e) {\n th...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_120
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNsMatch() {\n assertTrue(nsMatch(FactSpec.ns(\"default\"), new TestFact().ns(\"default\")));\n assertFalse(nsMatch(FactSpec.ns(\"default\"), new TestFact().ns(\"xxx\")));\n }", "class_method_signature": "FactSpecMatcherTest.testNsMatch()", "constructor": false, "f...
{ "fields": [ { "declarator": "scriptEngineCache = new LRUMap<>(10,\n 200)", "modifier": "private static final", "original_string": "private static final LRUMap<FilterScript, ScriptEngine> scriptEngineCache = new LRUMap<>(10,\n 200);", "type": "LRUMap<FilterScript, Sc...
{ "body": "protected boolean nsMatch(Fact t) {\n return ns.equals(t.ns());\n }", "class_method_signature": "FactSpecMatcher.nsMatch(Fact t)", "constructor": false, "full_signature": "protected boolean nsMatch(Fact t)", "identifier": "nsMatch", "invocations": [ "equals", "ns" ], "modifi...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_209
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n public void testEnumerateNamespaces() throws Exception {\n uut = new FactStoreGrpcService(backend);\n StreamObserver so = mock(StreamObserver.class);\n when(backend.enumerateNamespaces()).thenReturn(Sets.newHashSet(\"foo\", \"bar\"));\n\n uut.enumerateNamespaces(conv....
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void enumerateNamespaces(MSG_Empty request,\n StreamObserver<MSG_StringSet> responseObserver) {\n try {\n responseObserver.onNext(converter.toProto(store.enumerateNamespaces()));\n responseObserver.onCompleted();\n } catch (Throwable e) {...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_136
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testUnparsableHeader() {\n Assertions.assertThrows(JsonParseException.class, () -> {\n DefaultFact.of(\"not json at all\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testUnparsableHeader()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "jsonHeader", "modifier": "@Getter", "original_string": "@Getter\n String jsonHeader;", "type": "String", "var_name": "jsonHeader" }, { "declarator": "jsonPayload", "modifier": "@Getter", "original_string": "@Getter\n Stri...
{ "body": "public static Fact of(@NonNull String jsonHeader, @NonNull String jsonPayload) {\n return new DefaultFact(jsonHeader, jsonPayload);\n }", "class_method_signature": "DefaultFact.of(@NonNull String jsonHeader, @NonNull String jsonPayload)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_97
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testInvalidate() throws Exception {\n assertThrows(NullPointerException.class, () -> uut.invalidate(null));\n\n {\n UUID id = new UUID(0, 1);\n StateToken token = new StateToken(id);\n uut.invalidate(token);\n verify(blockingStub).in...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public void invalidate(@NonNull StateToken token) {\n MSG_UUID msg = converter.toProto(token.uuid());\n try {\n MSG_Empty msgEmpty = blockingStub.invalidate(msg);\n } catch (StatusRuntimeException e) {\n throw wrapRetryable(e);\n }\n }", ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_78
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void testPublishPropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.publish(any())).thenThrow(new StatusRuntimeException(Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.publish(Collections.singletonList(Fact\n .builder()\n...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@Override\n public void publish(@NonNull List<? extends Fact> factsToPublish) {\n log.trace(\"publishing {} facts to remote store\", factsToPublish.size());\n List<MSG_Fact> mf = factsToPublish.stream()\n .map(converter::toProto)\n .collect(Collectors\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_161
{ "fields": [ { "declarator": "store", "modifier": "@Mock\n private", "original_string": "@Mock\n private FactStore store;", "type": "FactStore", "var_name": "store" }, { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": ...
{ "body": "@Test\n public void testEnumerateTypes() throws Exception {\n Set<String> test = new HashSet<>();\n LinkedHashSet<String> other = Sets.newLinkedHashSet(\"foo\");\n\n when(store.enumerateTypes(\"test\")).thenReturn(test);\n assertSame(test, FactCast.from(store).enumerateTypes(...
{ "fields": [ { "declarator": "store", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final FactStore store;", "type": "FactStore", "var_name": "store" } ], "file": "factcast-core/src/main/java/org/factcast/core/DefaultFactCast.java", "identifier": "De...
{ "body": "@Override\n public Set<String> enumerateTypes(@NonNull String ns) {\n return store.enumerateTypes(ns);\n }", "class_method_signature": "DefaultFactCast.enumerateTypes(@NonNull String ns)", "constructor": false, "full_signature": "@Override public Set<String> enumerateTypes(@NonNull Strin...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_54
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n public void testFromProtoMSG_Facts() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_Facts) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testFromProtoMSG_Facts()", "constructor": false, "full_signatu...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public SubscriptionRequestTO fromProto(@NonNull MSG_SubscriptionRequest request) {\n return FactCastJson.readValue(SubscriptionRequestTO.class, request.getJson());\n }", "class_method_signature": "ProtoConverter.fromProto(@NonNull MSG_SubscriptionRequest request)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_2
{ "fields": [ { "declarator": "uut = new PgConfigurationProperties()", "modifier": "private", "original_string": "private PgConfigurationProperties uut = new PgConfigurationProperties();", "type": "PgConfigurationProperties", "var_name": "uut" } ], "file": "factcast-store-pgs...
{ "body": "@Test\n void testGetFetchSizeForIds() {\n assertEquals(25000, uut.getFetchSizeForIds());\n }", "class_method_signature": "PgConfigurationPropertiesTest.testGetFetchSizeForIds()", "constructor": false, "full_signature": "@Test void testGetFetchSizeForIds()", "identifier": "testGetFetchS...
{ "fields": [ { "declarator": "LEGACY_PREFIX = \"factcast.pg\"", "modifier": "private static final", "original_string": "private static final String LEGACY_PREFIX = \"factcast.pg\";", "type": "String", "var_name": "LEGACY_PREFIX" }, { "declarator": "env", "modifie...
{ "body": "public int getFetchSizeForIds() {\n return getQueueSizeForIds() / queueFetchRatio;\n }", "class_method_signature": "PgConfigurationProperties.getFetchSizeForIds()", "constructor": false, "full_signature": "public int getFetchSizeForIds()", "identifier": "getFetchSizeForIds", "invocation...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_15
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactTest.java", "identifier": "PgFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToUUIDArrayEmpty() {\n Set<UUID> res = PgFact.toUUIDArray(\"[]\");\n assertTrue(res.isEmpty());\n }", "class_method_signature": "PgFactTest.testToUUIDArrayEmpty()", "constructor": false, "full_signature": "@Test void testToUUIDArrayEmpty()", "identifier": "testT...
{ "fields": [ { "declarator": "id", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final UUID id;", "type": "UUID", "var_name": "id" }, { "declarator": "ns", "modifier": "@Getter\n @NonNull\n final", "ori...
{ "body": "@VisibleForTesting\n static Set<UUID> toUUIDArray(String aggIdArrayAsString) {\n Set<UUID> set = new LinkedHashSet<>();\n if (aggIdArrayAsString != null && aggIdArrayAsString.trim().length() > 2) {\n UUID[] readValue = FactCastJson.readValue(UUID[].class, aggIdArrayAsString);\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_42
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testCreateNotificationForIdNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.createNotificationFor((UUID) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testCreateNotificationForIdNull()", "constructor": false, "...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "public MSG_Notification createNotificationFor(@NonNull Fact t) {\n MSG_Notification.Builder builder = MSG_Notification.newBuilder()\n .setType(MSG_Notification.Type.Fact);\n builder.setFact(toProto(t));\n return builder.build();\n }", "class_method_signature": "Prot...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_225
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private StreamObserver<MSG_Notification> observer;", "type": "StreamObserver<MSG_Notification>", "var_name": "observer" }, { "declarator": "projection", "mod...
{ "body": "@Test\n void testOnError() {\n GrpcObserverAdapter uut = new GrpcObserverAdapter(\"foo\", observer, projection);\n verify(observer, never()).onNext(any());\n uut.onError(new Exception());\n verify(observer).onError(any());\n }", "class_method_signature": "GrpcObserverAda...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "id", "modifier": "@NonNull\n ...
{ "body": "@Override\n public void onError(Throwable e) {\n log.warn(\"{} onError – sending Error notification {}\", id, e.getMessage());\n observer.onError(e);\n tryComplete();\n }", "class_method_signature": "GrpcObserverAdapter.onError(Throwable e)", "constructor": false, "full_sig...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_194
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/SubscriptionRequestTOTest.java", "identifier": "SubscriptionRequestTOTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testMaxDelay() {\n final FactSpec s = FactSpec.ns(\"foo\");\n SubscriptionRequest r = SubscriptionRequest.catchup(s).fromScratch();\n SubscriptionRequestTO uut = SubscriptionRequestTO.forFacts(r);\n assertEquals(0, uut.maxBatchDelayInMs());\n uut.maxBatchD...
{ "fields": [ { "declarator": "maxBatchDelayInMs = 0", "modifier": "@JsonProperty", "original_string": "@JsonProperty\n long maxBatchDelayInMs = 0;", "type": "long", "var_name": "maxBatchDelayInMs" }, { "declarator": "continuous", "modifier": "@JsonProperty", ...
{ "body": "public static SubscriptionRequestTO forFacts(SubscriptionRequest request) {\n SubscriptionRequestTO t = new SubscriptionRequestTO(request);\n t.idOnly(false);\n return t;\n }", "class_method_signature": "SubscriptionRequestTO.forFacts(SubscriptionRequest request)", "constructor"...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_35
{ "fields": [ { "declarator": "uut = new ProtoConverter()", "modifier": "", "original_string": "ProtoConverter uut = new ProtoConverter();", "type": "ProtoConverter", "var_name": "uut" } ], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtoConverterTest...
{ "body": "@Test\n void testToProtoFactNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.toProto((Fact) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testToProtoFactNull()", "constructor": false, "full_signature": "@Test void testToPro...
{ "fields": [ { "declarator": "EMPTY = MSG_Empty.newBuilder().build()", "modifier": "private static final", "original_string": "private static final MSG_Empty EMPTY = MSG_Empty.newBuilder().build();", "type": "MSG_Empty", "var_name": "EMPTY" } ], "file": "factcast-grpc-api/sr...
{ "body": "@NonNull\n public MSG_UUID toProto(@NonNull UUID id) {\n return MSG_UUID.newBuilder()\n .setLsb(id.getLeastSignificantBits())\n .setMsb(id.getMostSignificantBits())\n .build();\n }", "class_method_signature": "ProtoConverter.toProto(@NonNull UUID ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_205
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n void testSubscribeFacts() {\n SubscriptionRequest req = SubscriptionRequest.catchup(FactSpec.ns(\"foo\")).fromNowOn();\n when(backend.subscribe(this.reqCaptor.capture(), any())).thenReturn(null);\n uut.subscribe(new ProtoConverter().toProto(SubscriptionRequestTO.forFacts(req...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void subscribe(MSG_SubscriptionRequest request,\n StreamObserver<MSG_Notification> responseObserver) {\n enableResponseCompression(responseObserver);\n\n SubscriptionRequestTO req = converter.fromProto(request);\n resetDebugInfo(req);\n BlockingS...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_62
{ "fields": [ { "declarator": "factObserver", "modifier": "@Mock", "original_string": "@Mock\n FactObserver factObserver;", "type": "FactObserver", "var_name": "factObserver" }, { "declarator": "uut", "modifier": "", "original_string": "ClientStreamObserv...
{ "body": "@Test\n void testOnNext() {\n Fact f = Fact.of(\"{\\\"ns\\\":\\\"ns\\\",\\\"id\\\":\\\"\" + UUID.randomUUID() + \"\\\"}\", \"{}\");\n MSG_Notification n = converter.createNotificationFor(f);\n uut.onNext(n);\n verify(factObserver).onNext(eq(f));\n }", "class_method_signa...
{ "fields": [ { "declarator": "converter = new ProtoConverter()", "modifier": "final", "original_string": "final ProtoConverter converter = new ProtoConverter();", "type": "ProtoConverter", "var_name": "converter" }, { "declarator": "subscription", "modifier": "@N...
{ "body": "@Override\n public void onNext(MSG_Notification f) {\n log.trace(\"observer got msg: {}\", f);\n switch (f.getType()) {\n case Catchup:\n log.debug(\"received onCatchup signal\");\n subscription.notifyCatchup();\n break;\n case Complete:\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_213
{ "fields": [ { "declarator": "backend", "modifier": "@Mock", "original_string": "@Mock\n FactStore backend;", "type": "FactStore", "var_name": "backend" }, { "declarator": "uut", "modifier": "", "original_string": "FactStoreGrpcService uut;", "type...
{ "body": "@Test\n void testFetchByIdThrows() {\n UUID id = UUID.randomUUID();\n when(backend.fetchById(any(UUID.class))).thenThrow(UnsupportedOperationException.class);\n StreamObserver so = mock(StreamObserver.class);\n uut.fetchById(conv.toProto(id), so);\n verify(so).onError(...
{ "fields": [ { "declarator": "PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0)", "modifier": "static final", "original_string": "static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.of(1, 1, 0);", "type": "ProtocolVersion", "var_name": "PROTOCOL_VERSION" }, { ...
{ "body": "@Override\n public void fetchById(MSG_UUID request,\n StreamObserver<MSG_OptionalFact> responseObserver) {\n try {\n enableResponseCompression(responseObserver);\n\n UUID fromProto = converter.fromProto(request);\n log.trace(\"fetchById {}\", fromProto)...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_74
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private GrpcFactStore uut;", "type": "GrpcFactStore", "var_name": "uut" }, { "declarator": "blockingStub", "modifier": "@Mock\n private", "...
{ "body": "@Test\n void configureCompressionChooseGzipIfAvail() {\n uut.configureCompression(\" gzip,lz3,lz4, lz99\");\n verify(stub).withCompression(\"gzip\");\n }", "class_method_signature": "GrpcFactStoreTest.configureCompressionChooseGzipIfAvail()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "codecs = new CompressionCodecs()", "modifier": "private final", "original_string": "private final CompressionCodecs codecs = new CompressionCodecs();", "type": "CompressionCodecs", "var_name": "codecs" }, { "declarator": "CHANNEL_NAME = \"...
{ "body": "@VisibleForTesting\n void configureCompression(String codecListFromServer) {\n codecs.selectFrom(codecListFromServer).ifPresent(c -> {\n log.info(\"configuring Codec \" + c);\n this.blockingStub = blockingStub.withCompression(c);\n this.stub = stub.withCompression...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_23
{ "fields": [ { "declarator": "uut", "modifier": "", "original_string": "PgConnectionSupplier uut;", "type": "PgConnectionSupplier", "var_name": "uut" }, { "declarator": "ds", "modifier": "@Mock\n private", "original_string": "@Mock\n private org.apach...
{ "body": "@Test\n void test_noRelevantPropertySet() {\n setupConnectionProperties(\"sockettimeout=30\");\n uut.buildPgConnectionProperties(ds);\n }", "class_method_signature": "PgConnectionSupplierTest.test_noRelevantPropertySet()", "constructor": false, "full_signature": "@Test void test_n...
{ "fields": [ { "declarator": "ds", "modifier": "@NonNull\n @VisibleForTesting\n protected final", "original_string": "@NonNull\n @VisibleForTesting\n protected final org.apache.tomcat.jdbc.pool.DataSource ds;", "type": "org.apache.tomcat.jdbc.pool.DataSource", "var_name"...
{ "body": "@VisibleForTesting\n Properties buildPgConnectionProperties(org.apache.tomcat.jdbc.pool.DataSource ds) {\n Properties dbp = new Properties();\n final PoolConfiguration poolProperties = ds.getPoolProperties();\n if (poolProperties != null) {\n setProperty(dbp, \"user\", po...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_182
{ "fields": [ { "declarator": "observer", "modifier": "@Mock\n private", "original_string": "@Mock\n private GenericObserver<Fact> observer;", "type": "GenericObserver<Fact>", "var_name": "observer" }, { "declarator": "uut", "modifier": "@InjectMocks\n pr...
{ "body": "@Test\n void testOnClose() throws Exception {\n CountDownLatch l = new CountDownLatch(1);\n uut.onClose(l::countDown);\n uut.close();\n l.await();\n }", "class_method_signature": "SubscriptionImplTest.testOnClose()", "constructor": false, "full_signature": "@Test voi...
{ "fields": [ { "declarator": "observer", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final GenericObserver<T> observer;", "type": "GenericObserver<T>", "var_name": "observer" }, { "declarator": "onClose = () -> {\n }", "modifier": "@No...
{ "body": "public SubscriptionImpl<T> onClose(Runnable e) {\n onClose = e;\n return this;\n }", "class_method_signature": "SubscriptionImpl.onClose(Runnable e)", "constructor": false, "full_signature": "public SubscriptionImpl<T> onClose(Runnable e)", "identifier": "onClose", "invocations":...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_58
{ "fields": [], "file": "factcast-grpc-api/src/test/java/org/factcast/grpc/api/conv/ProtocolVersionTest.java", "identifier": "ProtocolVersionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testIsCompatibleTo() {\n assertTrue(ProtocolVersion.of(1, 0, 0).isCompatibleTo(ProtocolVersion.of(1, 0, 0)));\n assertTrue(ProtocolVersion.of(1, 0, 0).isCompatibleTo(ProtocolVersion.of(1, 0, 1)));\n assertTrue(ProtocolVersion.of(1, 0, 0).isCompatibleTo(ProtocolVersion.o...
{ "fields": [ { "declarator": "major", "modifier": "final", "original_string": "final int major;", "type": "int", "var_name": "major" }, { "declarator": "minor", "modifier": "final", "original_string": "final int minor;", "type": "int", "var_name...
{ "body": "public boolean isCompatibleTo(ProtocolVersion other) {\n // patch level must be irrelevant\n return (major == other.major) && (minor <= other.minor);\n }", "class_method_signature": "ProtocolVersion.isCompatibleTo(ProtocolVersion other)", "constructor": false, "full_signature": "publ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_116
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecTest.java", "identifier": "FactSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testFactSpecAggId() {\n UUID id = UUID.randomUUID();\n assertEquals(id, FactSpec.ns(\"x\").aggId(id).aggId());\n }", "class_method_signature": "FactSpecTest.testFactSpecAggId()", "constructor": false, "full_signature": "@Test void testFactSpecAggId()", "identifier":...
{ "fields": [ { "declarator": "ns", "modifier": "@NonNull\n @JsonProperty\n final", "original_string": "@NonNull\n @JsonProperty\n final String ns;", "type": "String", "var_name": "ns" }, { "declarator": "type = null", "modifier": "@JsonProperty", ...
{ "body": "public static FactSpec ns(String ns) {\n return new FactSpec(ns);\n }", "class_method_signature": "FactSpec.ns(String ns)", "constructor": false, "full_signature": "public static FactSpec ns(String ns)", "identifier": "ns", "invocations": [], "modifiers": "public static", "parameter...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }
88544701_141
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testJsonHeader() {\n final UUID id = UUID.randomUUID();\n final UUID aid = UUID.randomUUID();\n final String header = \"{\\\"id\\\":\\\"\" + id\n + \"\\\",\\\"ns\\\":\\\"narf\\\",\\\"type\\\":\\\"foo\\\",\\\"aggIds\\\":[\\\"\" + aid\n + \"\...
{ "fields": [ { "declarator": "jsonHeader", "modifier": "@Getter", "original_string": "@Getter\n String jsonHeader;", "type": "String", "var_name": "jsonHeader" }, { "declarator": "jsonPayload", "modifier": "@Getter", "original_string": "@Getter\n Stri...
{ "body": "public static Fact of(@NonNull String jsonHeader, @NonNull String jsonPayload) {\n return new DefaultFact(jsonHeader, jsonPayload);\n }", "class_method_signature": "DefaultFact.of(@NonNull String jsonHeader, @NonNull String jsonPayload)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 88544701, "size": 95469, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/Mercateo/factcast" }