id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
88544701_19
{ "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 testDelayedMultipleExecution() {\n CondensedQueryExecutor uut = new CondensedQueryExecutor(22, callback, () -> true,\n mockTimer);\n verify(mockTimer, never()).schedule(any(), anyLong());\n uut.trigger();\n task.getAllValues().get(0).run();\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_157
{ "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 testSerialOf() {\n when(store.serialOf(any(UUID.class))).thenReturn(OptionalLong.empty());\n UUID id = UUID.randomUUID();\n uut.serialOf(id);\n verify(store).serialOf(same(id));\n }", "class_method_signature": "DefaultFactCastTest.testSerialOf()", "constru...
{ "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 OptionalLong serialOf(@NonNull UUID id) {\n return store.serialOf(id);\n }", "class_method_signature": "DefaultFactCast.serialOf(@NonNull UUID id)", "constructor": false, "full_signature": "@Override @NonNull public OptionalLong serialOf(@NonNull UUID id)...
{ "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_100
{ "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 testSubscribe() throws Exception {\n assertThrows(NullPointerException.class, () -> uut.subscribe(mock(\n SubscriptionRequestTO.class), null));\n assertThrows(NullPointerException.class, () -> uut.subscribe(null, null));\n assertThrows(NullPointerExceptio...
{ "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_36
{ "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 testFromProtoOptionalNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_OptionalFact) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testFromProtoOptionalNull()", "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_197
{ "fields": [ { "declarator": "uut = new SnappyGrpcServerCodec()", "modifier": "", "original_string": "SnappyGrpcServerCodec uut = new SnappyGrpcServerCodec();", "type": "SnappyGrpcServerCodec", "var_name": "uut" } ], "file": "factcast-server-grpc/src/test/java/org/factcast/s...
{ "body": "@Test\n void getMessageEncoding() {\n assertEquals(\"snappy\", uut.getMessageEncoding());\n }", "class_method_signature": "SnappyGrpcServerCodecTest.getMessageEncoding()", "constructor": false, "full_signature": "@Test void getMessageEncoding()", "identifier": "getMessageEncoding", "...
{ "fields": [], "file": "factcast-server-grpc/src/main/java/org/factcast/server/grpc/codec/SnappyGrpcServerCodec.java", "identifier": "SnappyGrpcServerCodec", "interfaces": "implements Codec", "methods": [ { "class_method_signature": "SnappyGrpcServerCodec.getMessageEncoding()", "constructor":...
{ "body": "@Override\n public String getMessageEncoding() {\n return \"snappy\";\n }", "class_method_signature": "SnappyGrpcServerCodec.getMessageEncoding()", "constructor": false, "full_signature": "@Override public String getMessageEncoding()", "identifier": "getMessageEncoding", "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_178
{ "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 testAwaitCatchup() {\n expect(TimeoutException.class, () -> uut.awaitCatchup(10));\n expect(TimeoutException.class, () -> uut.awaitComplete(10));\n uut.notifyCatchup();\n uut.awaitCatchup();\n expect(TimeoutException.class, () -> uut.awaitComplete(10));\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": "@Override\n public Subscription awaitCatchup() throws SubscriptionCancelledException {\n try {\n catchup.get();\n } catch (InterruptedException | ExecutionException e) {\n throw new SubscriptionCancelledException(e);\n }\n return this;\n }", "class_...
{ "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_206
{ "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 testSubscribeIds() {\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.forIds(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_61
{ "fields": [ { "declarator": "uut = new Lz4GrpcClientCodec()", "modifier": "", "original_string": "Lz4GrpcClientCodec uut = new Lz4GrpcClientCodec();", "type": "Lz4GrpcClientCodec", "var_name": "uut" } ], "file": "factcast-client-grpc/src/test/java/org/factcast/client/grpc/c...
{ "body": "@Test\n void getMessageEncoding() {\n assertEquals(\"lz4\", uut.getMessageEncoding());\n }", "class_method_signature": "Lz4GrpcClientCodecTest.getMessageEncoding()", "constructor": false, "full_signature": "@Test void getMessageEncoding()", "identifier": "getMessageEncoding", "invoca...
{ "fields": [], "file": "factcast-client-grpc/src/main/java/org/factcast/client/grpc/codec/Lz4GrpcClientCodec.java", "identifier": "Lz4GrpcClientCodec", "interfaces": "implements Codec", "methods": [ { "class_method_signature": "Lz4GrpcClientCodec.getMessageEncoding()", "constructor": false, ...
{ "body": "@Override\n public String getMessageEncoding() {\n return \"lz4\";\n }", "class_method_signature": "Lz4GrpcClientCodec.getMessageEncoding()", "constructor": false, "full_signature": "@Override public String getMessageEncoding()", "identifier": "getMessageEncoding", "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_210
{ "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 testEnumerateNamespacesThrows() throws Exception {\n uut = new FactStoreGrpcService(backend);\n StreamObserver so = mock(StreamObserver.class);\n when(backend.enumerateNamespaces()).thenThrow(UnsupportedOperationException.class);\n\n uut.enumerateNamespace...
{ "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_77
{ "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 testFetchByIdPropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.fetchById(any())).thenThrow(new StatusRuntimeException(\n Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.fetchById(UUID.randomUUID()));\n }", "cla...
{ "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 Optional<Fact> fetchById(UUID id) {\n log.trace(\"fetching {} from remote store\", id);\n\n MSG_OptionalFact fetchById;\n try {\n fetchById = blockingStub.fetchById(converter.toProto(id));\n } catch (StatusRuntimeException e) {\n throw...
{ "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_139
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testValidFact() {\n DefaultFact.of(\"{\\\"id\\\":\\\"\" + UUID.randomUUID() + \"\\\",\\\"ns\\\":\\\"default\\\"}\", \"{}\");\n }", "class_method_signature": "DefaultFactTest.testValidFact()", "constructor": false, "full_signature": "@Test void testValidFact()", "identifier...
{ "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_98
{ "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 testStateFor() throws Exception {\n assertThrows(NullPointerException.class, () -> uut.stateFor(Lists.emptyList(), null));\n assertThrows(NullPointerException.class, () -> uut.stateFor(null, null));\n assertThrows(NullPointerException.class, () -> uut.stateFor(null, Opt...
{ "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 StateToken stateFor(@NonNull Collection<UUID> forAggIds, @NonNull Optional<String> ns) {\n StateForRequest req = new StateForRequest(Lists.newArrayList(forAggIds), ns.orElse(null));\n MSG_StateForRequest msg = converter.toProto(req);\n try {\n MSG_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_181
{ "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 testNotifyErrorNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.notifyError(null);\n });\n }", "class_method_signature": "SubscriptionImplTest.testNotifyErrorNull()", "constructor": false, "full_signature": "@Test void testNotify...
{ "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 void notifyError(Throwable e) {\n if (!closed.get()) {\n observer.onError(e);\n if (!catchup.isDone()) {\n catchup.completeExceptionally(e);\n }\n if (!complete.isDone()) {\n complete.completeExceptionally(e);\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_20
{ "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 testDelayedCondensedExecution() {\n CondensedQueryExecutor uut = new CondensedQueryExecutor(104, callback, () -> true,\n mockTimer);\n // not yet scheduled anything\n verify(mockTimer, never()).schedule(any(), anyLong());\n uut.trigger();\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_115
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecTest.java", "identifier": "FactSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testFactSpecType() {\n assertEquals(\"y\", FactSpec.ns(\"x\").type(\"y\").type());\n }", "class_method_signature": "FactSpecTest.testFactSpecType()", "constructor": false, "full_signature": "@Test void testFactSpecType()", "identifier": "testFactSpecType", "invocations":...
{ "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_142
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testEqualityBasedOnId() {\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" }
88544701_154
{ "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 testSubscribeFactsNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.subscribeEphemeral(null, null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testSubscribeFactsNull()", "constructor": false, "full_signature": "@Te...
{ "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_103
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testCopyNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n FactCastJson.copy(null);\n });\n }", "class_method_signature": "FactCastJsonTest.testCopyNull()", "constructor": false, "full_signature": "@Test void testCopyNull()", "identi...
{ "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 copy(@NonNull T toCopy) {\n Class<?> c = toCopy.getClass();\n return reader.forType(c).readValue(writer.forType(c).writeValueAsString(toCopy));\n }", "class_method_signature": "FactCastJson.copy(@NonNull T toCopy)", "constructor": false, "full_s...
{ "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_174
{ "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 testAttemptWithoutPublishing() throws Exception {\n assertThrows(IllegalArgumentException.class, () -> {\n @NonNull PublishingResult attempt = uut.on(UUID.randomUUID()).attempt(() ->\n mock(IntermediatePublishResult.class)\n );\n ...
{ "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_123
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testScriptMatch() {\n assertTrue(scriptMatch(FactSpec.ns(\"default\"), new TestFact()));\n assertFalse(\n scriptMatch(FactSpec.ns(\"default\").jsFilterScript(\"function (h,e){ return false }\"),\n new TestFact()));\n assertTrue(scri...
{ "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": "@SneakyThrows\n @Generated\n protected boolean scriptMatch(Fact t) {\n if (script == null) {\n return true;\n }\n return (Boolean) scriptEngine.eval(\"test(\" + t.jsonHeader() + \",\" + t.jsonPayload() + \")\");\n }", "class_method_signature": "FactSpecMatcher.scr...
{ "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_82
{ "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 testInitializePropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.handshake(any())).thenThrow(new StatusRuntimeException(\n Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.initialize());\n }", "class_method_signa...
{ "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": "public synchronized void initialize() {\n if (!initialized.getAndSet(true)) {\n log.debug(\"Invoking handshake\");\n Map<String, String> serverProperties;\n ProtocolVersion serverProtocolVersion;\n try {\n ServerConfig cfg = converter.fromPr...
{ "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_94
{ "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 testCancelIsNotRetryable() throws Exception {\n ClientCall call = mock(ClientCall.class);\n doThrow(StatusRuntimeException.class).when(call).cancel(any(), any());\n\n try {\n uut.cancel(call);\n\n fail();\n } catch (Throwable e) {\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_135
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNullContracts() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n DefaultFact.of(null, null);\n });\n }", "class_method_signature": "DefaultFactTest.testNullContracts()", "constructor": false, "full_signature": "@Test void testNullContra...
{ "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_162
{ "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 testLockNullContract() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.lock(null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testLockNullContract()", "constructor": false, "full_signature": "@Test public v...
{ "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 LockedOperationBuilder lock(@NonNull String ns) {\n if (ns.trim().isEmpty())\n throw new IllegalArgumentException(\"Namespace must not be empty\");\n return new LockedOperationBuilder(this.store, ns);\n }", "class_method_signature": "DefaultFactCast.lock(...
{ "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_119
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testMetaMatch() {\n assertTrue(metaMatch(FactSpec.ns(\"default\").meta(\"foo\", \"bar\"), new TestFact().meta(\"foo\",\n \"bar\")));\n assertTrue(\n metaMatch(FactSpec.ns(\"default\").meta(\"foo\", \"bar\"), new TestFact().meta(\"x\", \"y\")\n ...
{ "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 metaMatch(Fact t) {\n if ((meta.isEmpty())) {\n return true;\n }\n return meta.entrySet().stream().allMatch(e -> e.getValue().equals(t.meta(e.getKey())));\n }", "class_method_signature": "FactSpecMatcher.metaMatch(Fact t)", "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_57
{ "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_CurrentDatabaseTimeNull() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n\n MSG_CurrentDatabaseTime t = null;\n uut.fromProto(t);\n });\n }", "class_method_signature": "ProtoConverterTest.testFromProtoM...
{ "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_1
{ "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 testGetQueueSizeForIds() {\n assertEquals(100000, uut.getQueueSizeForIds());\n }", "class_method_signature": "PgConfigurationPropertiesTest.testGetQueueSizeForIds()", "constructor": false, "full_signature": "@Test void testGetQueueSizeForIds()", "identifier": "testGetQueue...
{ "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 getQueueSizeForIds() {\n return queueSize * idOnlyFactor;\n }", "class_method_signature": "PgConfigurationProperties.getQueueSizeForIds()", "constructor": false, "full_signature": "public int getQueueSizeForIds()", "identifier": "getQueueSizeForIds", "invocations": [], "mod...
{ "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_158
{ "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 testSerialOfNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.serialOf(null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testSerialOfNull()", "constructor": false, "full_signature": "@Test void testSerialOfNull()",...
{ "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 OptionalLong serialOf(@NonNull UUID id) {\n return store.serialOf(id);\n }", "class_method_signature": "DefaultFactCast.serialOf(@NonNull UUID id)", "constructor": false, "full_signature": "@Override @NonNull public OptionalLong serialOf(@NonNull UUID id)...
{ "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_16
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactTest.java", "identifier": "PgFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToUUIDArraySingle() {\n UUID aggId1 = UUID.randomUUID();\n Set<UUID> res = PgFact.toUUIDArray(\"[\\\"\" + aggId1 + \"\\\"]\");\n assertEquals(1, res.size());\n assertTrue(res.contains(aggId1));\n }", "class_method_signature": "PgFactTest.testToUUIDArrayS...
{ "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_41
{ "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 testCreateNotificationForFactNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.createNotificationFor((Fact) null);\n });\n }", "class_method_signature": "ProtoConverterTest.testCreateNotificationForFactNull()", "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_226
{ "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 testOnNext() {\n ProtoConverter conv = new ProtoConverter();\n GrpcObserverAdapter uut = new GrpcObserverAdapter(\"foo\", observer,\n conv::createNotificationFor);\n doNothing().when(observer).onNext(msg.capture());\n verify(observer, never()).onNe...
{ "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 onNext(Fact element) {\n observer.onNext(projection.apply(element));\n }", "class_method_signature": "GrpcObserverAdapter.onNext(Fact element)", "constructor": false, "full_signature": "@Override public void onNext(Fact element)", "identifier": "onNext", "invo...
{ "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_40
{ "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 testCreateCompleteNotification() {\n MSG_Notification n = uut.createCompleteNotification();\n assertNotNull(n);\n assertEquals(MSG_Notification.Type.Complete, n.getType());\n }", "class_method_signature": "ProtoConverterTest.testCreateCompleteNotification()", "co...
{ "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 createCompleteNotification() {\n return MSG_Notification.newBuilder().setType(MSG_Notification.Type.Complete).build();\n }", "class_method_signature": "ProtoConverter.createCompleteNotification()", "constructor": false, "full_signature": "public MSG_Notification crea...
{ "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_159
{ "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 testEnumerateNamespaces() throws Exception {\n Set<String> set = new HashSet<>();\n when(store.enumerateNamespaces()).thenReturn(set);\n\n assertSame(set, FactCast.from(store).enumerateNamespaces());\n }", "class_method_signature": "DefaultFactCastTest.testE...
{ "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> enumerateNamespaces() {\n return store.enumerateNamespaces();\n }", "class_method_signature": "DefaultFactCast.enumerateNamespaces()", "constructor": false, "full_signature": "@Override public Set<String> enumerateNamespaces()", "identifier": "enumerateNa...
{ "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_17
{ "fields": [], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactTest.java", "identifier": "PgFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToUUIDArrayMutli() {\n UUID aggId1 = UUID.randomUUID();\n UUID aggId2 = UUID.randomUUID();\n Set<UUID> res = PgFact.toUUIDArray(\"[\\\"\" + aggId1 + \"\\\",\\\"\" + aggId2 + \"\\\"]\");\n assertEquals(2, res.size());\n assertTrue(res.contains(aggId1));...
{ "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_0
{ "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 testGetPageSizeForIds() {\n assertEquals(100000, uut.getPageSizeForIds());\n }", "class_method_signature": "PgConfigurationPropertiesTest.testGetPageSizeForIds()", "constructor": false, "full_signature": "@Test void testGetPageSizeForIds()", "identifier": "testGetPageSizeF...
{ "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 getPageSizeForIds() {\n return pageSize * idOnlyFactor;\n }", "class_method_signature": "PgConfigurationProperties.getPageSizeForIds()", "constructor": false, "full_signature": "public int getPageSizeForIds()", "identifier": "getPageSizeForIds", "invocations": [], "modifier...
{ "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_118
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecTest.java", "identifier": "FactSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testJsFilterScriptDeserDownwardCompatibility() throws Exception {\n String script = \"foo\";\n String json = \"{\\\"ns\\\":\\\"x\\\",\\\"jsFilterScript\\\":\\\"\" + script + \"\\\"}\";\n\n FactSpec spec = FactCastJson.readValue(FactSpec.class, json);\n\n a...
{ "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 FilterScript filterScript() {\n if (filterScript != null)\n return filterScript;\n else if (jsFilterScript != null)\n return new FilterScript(\"js\", jsFilterScript);\n else\n return null;\n }", "class_method_signature": "FactSpec.filterScri...
{ "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_56
{ "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 testToProtoConditionalPublishRequest() throws Exception {\n\n assertThrows(NullPointerException.class, () -> {\n uut.toProto((ConditionalPublishRequest) null);\n });\n\n {\n UUID id = UUID.randomUUID();\n Fact f2 = new TestFact();...
{ "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_163
{ "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 testLockNamespaceMustNotBeEmpty() throws Exception {\n assertThrows(IllegalArgumentException.class, () -> {\n uut.lock(\" \");\n });\n }", "class_method_signature": "DefaultFactCastTest.testLockNamespaceMustNotBeEmpty()", "constructor": false, "full_...
{ "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 LockedOperationBuilder lock(@NonNull String ns) {\n if (ns.trim().isEmpty())\n throw new IllegalArgumentException(\"Namespace must not be empty\");\n return new LockedOperationBuilder(this.store, ns);\n }", "class_method_signature": "DefaultFactCast.lock(...
{ "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_95
{ "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 testSubscribeNullParameters() throws Exception {\n expectNPE(() -> uut.subscribe(null, mock(FactObserver.class)));\n expectNPE(() -> uut.subscribe(mock(SubscriptionRequestTO.class), null));\n expectNPE(() -> uut.subscribe(null, null));\n }", "class_method_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": "@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_134
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNullPayload() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n DefaultFact.of(null, \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testNullPayload()", "constructor": false, "full_signature": "@Test void testNullPayload(...
{ "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_122
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testAggIdMatch() {\n UUID u1 = UUID.randomUUID();\n UUID u2 = UUID.randomUUID();\n assertTrue(aggIdMatch(FactSpec.ns(\"default\").aggId(u1), new TestFact().aggId(u1)));\n assertTrue(aggIdMatch(FactSpec.ns(\"default\"), new TestFact().aggId(u1)));\n assertF...
{ "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 aggIdMatch(Fact t) {\n if (aggId == null) {\n return true;\n }\n return t.aggIds().contains(aggId);\n }", "class_method_signature": "FactSpecMatcher.aggIdMatch(Fact t)", "constructor": false, "full_signature": "protected boolean aggIdMatch(Fact t)"...
{ "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_83
{ "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 testEnumerateNamespacesPropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.enumerateNamespaces(any())).thenThrow(new StatusRuntimeException(\n Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.enumerateNamespaces());\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 Set<String> enumerateNamespaces() {\n MSG_Empty empty = converter.empty();\n MSG_StringSet resp;\n try {\n resp = blockingStub.enumerateNamespaces(empty);\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_175
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/lock/ExceptionAfterPublishTest.java", "identifier": "ExceptionAfterPublishTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testExceptionAfterPublish() throws Exception {\n Throwable e = Mockito.mock(Exception.class);\n List facts = new LinkedList<>();\n ExceptionAfterPublish uut = new ExceptionAfterPublish(facts, e);\n assertThat(uut.publishedFacts()).isSameAs(facts);\n ...
{ "fields": [ { "declarator": "publishedFacts", "modifier": "@Getter\n @NonNull\n private", "original_string": "@Getter\n @NonNull\n private List<Fact> publishedFacts;", "type": "List<Fact>", "var_name": "publishedFacts" }, { "declarator": "serialVersionUID ...
{ "body": "public ExceptionAfterPublish(@NonNull List<Fact> publishedFacts, @NonNull Throwable e) {\n super(\"An exception has happened in the 'andThen' part of your publishing attempt. \"\n + \"This is a programming error, as the runnable in andThen is not supposed to throw an Exception. \"\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_102
{ "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 testCurrentTimePropagatesRetryableExceptionOnUnavailableStatus() {\n when(blockingStub.enumerateNamespaces(any())).thenThrow(new StatusRuntimeException(\n Status.UNAVAILABLE));\n assertThrows(RetryableException.class, () -> uut.enumerateNamespaces());\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 Set<String> enumerateNamespaces() {\n MSG_Empty empty = converter.empty();\n MSG_StringSet resp;\n try {\n resp = blockingStub.enumerateNamespaces(empty);\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_155
{ "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 testSubscribeFacts1stArgNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.subscribeEphemeral(null, f -> {\n });\n });\n }", "class_method_signature": "DefaultFactCastTest.testSubscribeFacts1stArgNull()", "constructor": fa...
{ "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_143
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testEqualityMustBeBasedOnIDOnly() {\n UUID id = UUID.randomUUID();\n Fact f1 = DefaultFact.of(\"{\\\"id\\\":\\\"\" + id\n + \"\\\",\\\"ns\\\":\\\"narf\\\",\\\"type\\\":\\\"foo\\\",\\\"aggIds\\\":[\\\"\" + UUID.randomUUID()\n + \"\\\"],\\\"meta\\\"...
{ "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_114
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecTest.java", "identifier": "FactSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@SuppressWarnings(\"static-access\")\n @Test\n void testFactSpecNs() {\n assertEquals(\"y\", FactSpec.ns(\"x\").ns(\"y\").ns());\n }", "class_method_signature": "FactSpecTest.testFactSpecNs()", "constructor": false, "full_signature": "@SuppressWarnings(\"static-access\") @Test void te...
{ "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_180
{ "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 testNotifyElementNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.notifyElement(null);\n });\n }", "class_method_signature": "SubscriptionImplTest.testNotifyElementNull()", "constructor": false, "full_signature": "@Test void test...
{ "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 void notifyElement(@NonNull T e) {\n if (!closed.get()) {\n observer.onNext(e);\n }\n }", "class_method_signature": "SubscriptionImpl.notifyElement(@NonNull T e)", "constructor": false, "full_signature": "public void notifyElement(@NonNull T e)", "identifier": "no...
{ "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_21
{ "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 testListen() throws Exception {\n Mockito.when(ds.get()).thenReturn(conn);\n Mockito.when(conn.prepareStatement(anyString())).thenReturn(ps);\n\n PgListener l = new PgListener(ds, bus, tester);\n l.afterPropertiesSet();\n sleep(100);\n verify(bus).p...
{ "fields": [ { "declarator": "pgConnectionSupplier", "modifier": "@NonNull\n final", "original_string": "@NonNull\n final PgConnectionSupplier pgConnectionSupplier;", "type": "PgConnectionSupplier", "var_name": "pgConnectionSupplier" }, { "declarator": "eventBus"...
{ "body": "private void listen() {\n log.trace(\"Starting instance Listener\");\n CountDownLatch l = new CountDownLatch(1);\n listenerThread = new Thread(() -> {\n while (running.get()) {\n // make sure, we did not miss anything while reconnecting\n postEv...
{ "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_76
{ "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 testPublishPropagatesException() {\n when(blockingStub.publish(any())).thenThrow(new SomeException());\n assertThrows(SomeException.class, () -> uut.publish(Collections.singletonList(Fact.builder()\n .build(\"{}\"))));\n }", "class_method_signature": "GrpcF...
{ "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_138
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testIdNotUUID() {\n Assertions.assertThrows(IOException.class, () -> {\n DefaultFact.of(\"{\\\"id\\\":\\\"buh\\\",\\\"ns\\\":\\\"default\\\"}\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testIdNotUUID()", "constructor": false, "full_si...
{ "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_99
{ "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 testPublishIfUnchanged() throws Exception {\n assertThrows(NullPointerException.class, () -> uut.publishIfUnchanged(Lists.emptyList(),\n null));\n assertThrows(NullPointerException.class, () -> uut.publishIfUnchanged(null, null));\n assertThrows(NullPoint...
{ "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 boolean publishIfUnchanged(@NonNull List<? extends Fact> factsToPublish,\n @NonNull Optional<StateToken> token) {\n\n ConditionalPublishRequest req = new ConditionalPublishRequest(factsToPublish, token.map(\n StateToken::uuid).orElse(null));\n M...
{ "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_211
{ "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 testEnumerateTypes() throws Exception {\n uut = new FactStoreGrpcService(backend);\n StreamObserver so = mock(StreamObserver.class);\n\n when(backend.enumerateTypes(eq(\"ns\"))).thenReturn(Sets.newHashSet(\"foo\", \"bar\"));\n\n uut.enumerateTypes(conv.toP...
{ "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_60
{ "fields": [ { "declarator": "uut = new SnappyGrpcClientCodec()", "modifier": "", "original_string": "SnappyGrpcClientCodec uut = new SnappyGrpcClientCodec();", "type": "SnappyGrpcClientCodec", "var_name": "uut" } ], "file": "factcast-client-grpc/src/test/java/org/factcast/c...
{ "body": "@Test\n void getMessageEncoding() {\n assertEquals(\"snappy\", uut.getMessageEncoding());\n }", "class_method_signature": "SnappyGrpcClientCodecTest.getMessageEncoding()", "constructor": false, "full_signature": "@Test void getMessageEncoding()", "identifier": "getMessageEncoding", "...
{ "fields": [], "file": "factcast-client-grpc/src/main/java/org/factcast/client/grpc/codec/SnappyGrpcClientCodec.java", "identifier": "SnappyGrpcClientCodec", "interfaces": "implements Codec", "methods": [ { "class_method_signature": "SnappyGrpcClientCodec.getMessageEncoding()", "constructor":...
{ "body": "@Override\n public String getMessageEncoding() {\n return \"snappy\";\n }", "class_method_signature": "SnappyGrpcClientCodec.getMessageEncoding()", "constructor": false, "full_signature": "@Override public String getMessageEncoding()", "identifier": "getMessageEncoding", "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_207
{ "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 testSerialOf() throws Exception {\n uut = new FactStoreGrpcService(backend);\n\n StreamObserver so = mock(StreamObserver.class);\n assertThrows(NullPointerException.class, () -> {\n uut.serialOf(null, so);\n });\n\n UUID id = new UUID(0, ...
{ "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_37
{ "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_empty() {\n MSG_Facts proto = uut.toProto(new ArrayList<Fact>());\n\n assertTrue(proto.getFactList().isEmpty());\n }", "class_method_signature": "ProtoConverterTest.testToProtoFacts_empty()", "constructor": false, "full_signature": "@Test void testToP...
{ "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_196
{ "fields": [ { "declarator": "uut = new Lz4GrpcServerCodec()", "modifier": "", "original_string": "Lz4GrpcServerCodec uut = new Lz4GrpcServerCodec();", "type": "Lz4GrpcServerCodec", "var_name": "uut" } ], "file": "factcast-server-grpc/src/test/java/org/factcast/server/grpc/c...
{ "body": "@Test\n void getMessageEncoding() {\n assertEquals(\"lz4\", uut.getMessageEncoding());\n }", "class_method_signature": "Lz4GrpcServerCodecTest.getMessageEncoding()", "constructor": false, "full_signature": "@Test void getMessageEncoding()", "identifier": "getMessageEncoding", "invoca...
{ "fields": [], "file": "factcast-server-grpc/src/main/java/org/factcast/server/grpc/codec/Lz4GrpcServerCodec.java", "identifier": "Lz4GrpcServerCodec", "interfaces": "implements Codec", "methods": [ { "class_method_signature": "Lz4GrpcServerCodec.getMessageEncoding()", "constructor": false, ...
{ "body": "@Override\n public String getMessageEncoding() {\n return \"lz4\";\n }", "class_method_signature": "Lz4GrpcServerCodec.getMessageEncoding()", "constructor": false, "full_signature": "@Override public String getMessageEncoding()", "identifier": "getMessageEncoding", "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_179
{ "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 testAwaitComplete() {\n expect(TimeoutException.class, () -> uut.awaitCatchup(10));\n expect(TimeoutException.class, () -> uut.awaitComplete(10));\n uut.notifyComplete();\n uut.awaitCatchup();\n uut.awaitComplete();\n }", "class_method_signature": "Su...
{ "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 Subscription awaitComplete() throws SubscriptionCancelledException {\n try {\n complete.get();\n } catch (InterruptedException | ExecutionException e) {\n throw new SubscriptionCancelledException(e);\n }\n return this;\n }", "clas...
{ "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_172
{ "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 testAttemptNullContracts() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.on(UUID.randomUUID()).attempt(null);\n });\n }", "class_method_signature": "LockedOperationBuilderTest.testAttemptNullContracts()", "constructor": fa...
{ "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_84
{ "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 testEnumerateNamespaces() {\n HashSet<String> ns = Sets.newHashSet(\"foo\", \"bar\");\n when(blockingStub.enumerateNamespaces(conv.empty())).thenReturn(conv.toProto(ns));\n Set<String> enumerateNamespaces = uut.enumerateNamespaces();\n assertEquals(ns, enumerateN...
{ "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 Set<String> enumerateNamespaces() {\n MSG_Empty empty = converter.empty();\n MSG_StringSet resp;\n try {\n resp = blockingStub.enumerateNamespaces(empty);\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_125
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/FactSpecMatcherTest.java", "identifier": "FactSpecMatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testMatchesAnyOf() {\n Predicate<Fact> p = FactSpecMatcher.matchesAnyOf(Arrays.asList(FactSpec.ns(\"1\"), FactSpec\n .ns(\"2\")));\n assertTrue(p.test(new TestFact().ns(\"1\")));\n assertTrue(p.test(new TestFact().ns(\"2\")));\n assertFalse(p.test(...
{ "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> matchesAnyOf(@NonNull List<FactSpec> spec) {\n List<FactSpecMatcher> matchers = spec.stream()\n .map(FactSpecMatcher::new)\n .collect(Collectors.toList());\n return f -> matchers.stream().anyMatch(p -> p.test(f));\n }", "class_m...
{ "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_133
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testNullHeader() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n DefaultFact.of(\"{}\", null);\n });\n }", "class_method_signature": "DefaultFactTest.testNullHeader()", "constructor": false, "full_signature": "@Test void testNullHeader()",...
{ "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_92
{ "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() throws Exception {\n StatusRuntimeException cause = new StatusRuntimeException(Status.UNAVAILABLE);\n RuntimeException e = GrpcFactStore.wrapRetryable(cause);\n assertTrue(e instanceof RetryableException);\n assertSame(e.getCause(), cause);\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 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_164
{ "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 testSubscribeNullContracts() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.subscribe(null, mock(FactObserver.class));\n });\n assertThrows(NullPointerException.class, () -> {\n uut.subscribe(null, null);\n ...
{ "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 Subscription subscribe(@NonNull SubscriptionRequest request,\n @NonNull FactObserver observer) {\n return new ReconnectingFactSubscriptionWrapper(store, SubscriptionRequestTO.forFacts(\n request),\n observer);\n }", "class_method_si...
{ "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_51
{ "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_nsNotSet() throws Exception {\n\n MSG_StateForRequest request = MSG_StateForRequest.newBuilder()\n .setNs(\"foo\")\n .setNsPresent(false)\n .addAggIds(MSG_UUID.newBuilder().setLsb(1).setMsb(2).build(...
{ "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_7
{ "fields": [ { "declarator": "uut", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n PgFactStream uut;", "type": "PgFactStream", "var_name": "uut" } ], "file": "factcast-store-pgsql/src/test/java/org/factcast/store/pgsql/internal/PgFactStreamTest.java", "i...
{ "body": "@Test\n public void testConnectNullParameter() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.connect(null);\n });\n }", "class_method_signature": "PgFactStreamTest.testConnectNullParameter()", "constructor": false, "full_signature": "@Test ...
{ "fields": [ { "declarator": "jdbcTemplate", "modifier": "final", "original_string": "final JdbcTemplate jdbcTemplate;", "type": "JdbcTemplate", "var_name": "jdbcTemplate" }, { "declarator": "eventBus", "modifier": "final", "original_string": "final EventBu...
{ "body": "void connect(@NonNull SubscriptionRequestTO request) {\n this.request = request;\n log.debug(\"{} connecting subscription {}\", request, request.dump());\n postQueryMatcher = new PgPostQueryMatcher(request);\n PgQueryBuilder q = new PgQueryBuilder(request);\n initializeSe...
{ "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_148
{ "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 testPublish() {\n doNothing().when(store).publish(cfacts.capture());\n final TestFact f = new TestFact();\n uut.publish(f);\n final List<Fact> l = cfacts.getValue();\n assertEquals(1, l.size());\n assertTrue(l.contains(f));\n }", "class_method_...
{ "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_10
{ "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 testMapRowNullContracts() throws Exception {\n\n assertThrows(NullPointerException.class, () -> {\n uut.mapRow(null, 1);\n });\n }", "class_method_signature": "PgFactExtractorTest.testMapRowNullContracts()", "constructor": false, "full_signature": "@Test vo...
{ "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_109
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToObjectNodeNonJson() {\n Assertions.assertThrows(RuntimeException.class, () -> {\n FactCastJson.toObjectNode(\"no-json\");\n });\n }", "class_method_signature": "FactCastJsonTest.testToObjectNodeNonJson()", "constructor": false, "full_signature": "@Tes...
{ "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_47
{ "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_OptionalSerial() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n uut.fromProto((MSG_OptionalSerial) null);\n });\n\n assertFalse(uut.fromProto(MSG_OptionalSerial.newBuilder()\n .setPresent(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 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_220
{ "fields": [ { "declarator": "uut = new GrpcCompressionInterceptor(new CompressionCodecs())", "modifier": "", "original_string": "GrpcCompressionInterceptor uut = new GrpcCompressionInterceptor(new CompressionCodecs());", "type": "GrpcCompressionInterceptor", "var_name": "uut" }...
{ "body": "@Test\n void interceptCallWithoutCompression() {\n ServerCall call = mock(ServerCall.class);\n Metadata metadata = mock(Metadata.class);\n ServerCallHandler next = mock(ServerCallHandler.class);\n\n uut.interceptCall(call, metadata, next);\n\n verify(next).startCall(ca...
{ "fields": [ { "declarator": "GRPC_ACCEPT_ENCODING = Metadata.Key.of(\"grpc-accept-encoding\",\n Metadata.ASCII_STRING_MARSHALLER)", "modifier": "public final", "original_string": "public final Metadata.Key<String> GRPC_ACCEPT_ENCODING = Metadata.Key.of(\"grpc-accept-encoding\",\n ...
{ "body": "@Override\n public <ReqT, RespT> Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,\n Metadata headers, ServerCallHandler<ReqT, RespT> next) {\n codecs.selectFrom(headers.get(GRPC_ACCEPT_ENCODING)).ifPresent(c -> {\n call.setCompression(c);\n // server cod...
{ "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_191
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/SubscriptionRequestTOTest.java", "identifier": "SubscriptionRequestTOTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testDebugInfo() {\n SubscriptionRequest r = SubscriptionRequest.catchup(FactSpec.ns(\"foo\")).fromScratch();\n SubscriptionRequestTO uut = SubscriptionRequestTO.forFacts(r);\n assertEquals(r.debugInfo(), uut.debugInfo());\n }", "class_method_signature": "Subscripti...
{ "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_30
{ "fields": [], "file": "factcast-store-inmem/src/test/java/org/factcast/store/inmem/InMemFactTest.java", "identifier": "InMemFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception {\n Fact f = Fact.of(\"{\\\"ns\\\":\\\"someNs\\\",\\\"id\\\":\\\"\" + UUID.randomUUID()\n + \"\\\"}\", \"{}\");\n\n InMemFact f1 = new InMemFact(32, f);\n Fact d = FactCastJson.readValue(DefaultFact.class, f1.toStrin...
{ "fields": [], "file": "factcast-store-inmem/src/main/java/org/factcast/store/inmem/InMemFact.java", "identifier": "InMemFact", "interfaces": "", "methods": [ { "class_method_signature": "InMemFact.InMemFact(long ser, Fact toCopyFrom)", "constructor": true, "full_signature": "public In...
{ "body": "@Override\n public String toString() {\n return FactCastJson.writeValueAsPrettyString(this);\n }", "class_method_signature": "InMemFact.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "writeValu...
{ "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_200
{ "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 testOnNextWhenReady() {\n when(delegate.isReady()).thenReturn(true);\n uut.onNext(new Object());\n verify(delegate).onNext(any());\n }", "class_method_signature": "BlockingStreamObserverTest.testOnNextWhenReady()", "constructor": false, "full_signature": "@Test...
{ "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 onNext(T value) {\n if (!delegate.isCancelled()) {\n synchronized (lock) {\n if (!delegate.isReady()) {\n for (int i = 1; i <= RETRY_COUNT; i++) {\n log.debug(\"{} channel not ready. Slow client? Attempt: ...
{ "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_67
{ "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 testOnComplete() {\n uut.onNext(converter.createCompleteNotification());\n verify(factObserver).onComplete();\n }", "class_method_signature": "ClientStreamObserverTest.testOnComplete()", "constructor": false, "full_signature": "@Test void testOnComplete()", "identif...
{ "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_129
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/IdOnlyFactTest.java", "identifier": "IdOnlyFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testAggIds() {\n Assertions.assertThrows(UnsupportedOperationException.class, () -> {\n new IdOnlyFact(UUID.randomUUID()).aggIds();\n });\n }", "class_method_signature": "IdOnlyFactTest.testAggIds()", "constructor": false, "full_signature": "@Test void test...
{ "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 Set<UUID> aggIds() {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "IdOnlyFact.aggIds()", "constructor": false, "full_signature": "@Override public Set<UUID> aggIds()", "identifier": "aggIds", "invocations": [], "modifiers": "@Overr...
{ "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_88
{ "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 testCompatibleProtocolVersion() {\n when(blockingStub.handshake(any()))\n .thenReturn(conv.toProto(ServerConfig.of(ProtocolVersion.of(1, 1, 0),\n new HashMap<>())));\n uut.initialize();\n }", "class_method_signature": "GrpcFactStoreTe...
{ "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": "public synchronized void initialize() {\n if (!initialized.getAndSet(true)) {\n log.debug(\"Invoking handshake\");\n Map<String, String> serverProperties;\n ProtocolVersion serverProtocolVersion;\n try {\n ServerConfig cfg = converter.fromPr...
{ "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_216
{ "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 testRetrieveImplementationVersion() throws Exception {\n uut = spy(uut);\n when(uut.getProjectProperties()).thenReturn(this.getClass()\n .getResource(\n \"/test.properties\"));\n HashMap<String, String> map = new HashMap<>();...
{ "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": "@VisibleForTesting\n void retrieveImplementationVersion(HashMap<String, String> properties) {\n String implVersion = \"UNKNOWN\";\n URL propertiesUrl = getProjectProperties();\n Properties buildProperties = new Properties();\n if (propertiesUrl != null) {\n try {\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_71
{ "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 testFetchByIdFound() {\n UUID id = UUID.randomUUID();\n when(blockingStub.fetchById(eq(conv.toProto(id))))\n .thenReturn(conv.toProto(Optional.of(Fact.builder().ns(\"test\").build(\"{}\"))));\n Optional<Fact> fetchById = uut.fetchById(id);\n assert...
{ "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 Optional<Fact> fetchById(UUID id) {\n log.trace(\"fetching {} from remote store\", id);\n\n MSG_OptionalFact fetchById;\n try {\n fetchById = blockingStub.fetchById(converter.toProto(id));\n } catch (StatusRuntimeException e) {\n throw...
{ "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_26
{ "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_invalidConnectionProperties() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n // given\n setupConnectionProperties(\"socketTimeout=30;connectTimeout=20,loginTimeout=10;\");\n // when\n uut.buildPgConnectionPropert...
{ "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_187
{ "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 testAwaitCatchup() throws Exception {\n\n observerAC.getValue().onCatchup();\n\n assertTimeout(Duration.ofMillis(1000), () -> {\n // needs to return immediately\n uut.awaitCatchup();\n });\n }", "class_method_signature": "ReconnectingFa...
{ "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_168
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/lock/IntermediatePublishResultTest.java", "identifier": "IntermediatePublishResultTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullContracts() throws Exception {\n assertThrows(NullPointerException.class, () -> {\n new IntermediatePublishResult(null);\n });\n\n assertThrows(NullPointerException.class, () -> {\n new IntermediatePublishResult(new LinkedList<>()).a...
{ "fields": [ { "declarator": "factsToPublish", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final List<Fact> factsToPublish;", "type": "List<Fact>", "var_name": "factsToPublish" }, { "declarator": "andThen = null", ...
{ "body": "public Optional<Runnable> andThen() {\n return Optional.ofNullable(andThen);\n }", "class_method_signature": "IntermediatePublishResult.andThen()", "constructor": false, "full_signature": "public Optional<Runnable> andThen()", "identifier": "andThen", "invocations": [ "ofNullable" ...
{ "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_113
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/spec/JavaScriptEngineSupplierTest.java", "identifier": "JavaScriptEngineSupplierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testGet() throws Exception {\n JavaScriptEngineSupplier uut = spy(new JavaScriptEngineSupplier());\n uut.get();\n verify(uut).getEngineByName(new String[] { \"nashorn\", \"javascript\", \"js\" });\n }", "class_method_signature": "JavaScriptEngineSupplierTest.testGe...
{ "fields": [ { "declarator": "staticEngineManager = new ScriptEngineManager()", "modifier": "private static final", "original_string": "private static final ScriptEngineManager staticEngineManager = new ScriptEngineManager();", "type": "ScriptEngineManager", "var_name": "staticEngin...
{ "body": "@Override\n public ScriptEngine get() {\n ScriptEngine engine = getEngineByName(\"nashorn\", \"javascript\", \"js\");\n if (engine == null)\n throw new IllegalStateException(\"Cannot find any engine to run javascript code.\");\n return engine;\n }", "class_method_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_144
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testOfNoId() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n Fact.of(\"{\\\"ns\\\":\\\"narf\\\"}\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testOfNoId()", "constructor": false, "full_signature": "@Test void test...
{ "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_152
{ "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 testPublishWithAggregatedException() {\n try {\n uut.publish(new NullFact());\n fail();\n } catch (FactValidationException e) {\n assertThat(e.getMessage()).contains(\"lacks required namespace\");\n assertThat(e.getMessage()).contain...
{ "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_105
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testReadValueNull() {\n expectNPE(() -> FactCastJson.readValue(null, \"\"));\n expectNPE(() -> FactCastJson.readValue(null, (String) null));\n expectNPE(() -> FactCastJson.readValue(FactCastJson.class, (String) null));\n expectNPE(() -> FactCastJson.readValue(nul...
{ "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_104
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testCopy() {\n final Foo foo = new Foo(\"bar\", \"baz\");\n Foo copy = FactCastJson.copy(foo);\n assertNotSame(foo, copy);\n assertNotEquals(foo, copy);\n assertEquals(foo.bar(), copy.bar());\n assertNull(copy.baz());\n }", "class_method_signat...
{ "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 copy(@NonNull T toCopy) {\n Class<?> c = toCopy.getClass();\n return reader.forType(c).readValue(writer.forType(c).writeValueAsString(toCopy));\n }", "class_method_signature": "FactCastJson.copy(@NonNull T toCopy)", "constructor": false, "full_s...
{ "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_153
{ "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 testPublishManyNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.publish((List<Fact>) null);\n });\n }", "class_method_signature": "DefaultFactCastTest.testPublishManyNull()", "constructor": false, "full_signature": "@Test void te...
{ "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_145
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/DefaultFactTest.java", "identifier": "DefaultFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testOfNoNs() {\n Assertions.assertThrows(IllegalArgumentException.class, () -> {\n Fact.of(\"{\\\"id\\\":\\\"\" + UUID.randomUUID() + \"\\\"}\", \"{}\");\n });\n }", "class_method_signature": "DefaultFactTest.testOfNoNs()", "constructor": false, "full_signa...
{ "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_112
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/util/FactCastJsonTest.java", "identifier": "FactCastJsonTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testWriteValueAsPrettyFromObject() {\n @Data\n class TestObject {\n String foo = \"bar\";\n }\n\n String pretty = FactCastJson.writeValueAsPrettyString(new TestObject());\n System.out.println(pretty);\n assertTrue(pretty.contains(\"\\\"fo...
{ "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_27
{ "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 shouldReturnFromAfterInitSameBeanAsPassed() throws Exception {\n UUID instance = UUID.randomUUID();\n\n Object afterInit = uut.postProcessAfterInitialization(instance, \"foo\");\n\n assertThat(afterInit).isSameAs(instance);\n }", "class_method_signature": "R...
{ "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 postProcessAfterInitialization(@NonNull Object bean, @NonNull String beanName)\n throws BeansException {\n return bean;\n }", "class_method_signature": "RdsDataSourceFactoryBeanPostProcessor.postProcessAfterInitialization(@NonNull Object bea...
{ "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_186
{ "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 testAwaitCompleteLong() throws Exception {\n when(subscription.awaitComplete(anyLong())).thenThrow(TimeoutException.class)\n .then(x -> subscription);\n\n assertThrows(TimeoutException.class, () -> {\n uut.awaitComplete(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 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_169
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/lock/IntermediatePublishResultTest.java", "identifier": "IntermediatePublishResultTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAndThen() throws Exception {\n IntermediatePublishResult uut = new IntermediatePublishResult(new LinkedList<>()).andThen(\n () -> {\n });\n assertThat(uut.andThen()).isPresent();\n }", "class_method_signature": "IntermediatePublish...
{ "fields": [ { "declarator": "factsToPublish", "modifier": "@Getter\n @NonNull\n final", "original_string": "@Getter\n @NonNull\n final List<Fact> factsToPublish;", "type": "List<Fact>", "var_name": "factsToPublish" }, { "declarator": "andThen = null", ...
{ "body": "public Optional<Runnable> andThen() {\n return Optional.ofNullable(andThen);\n }", "class_method_signature": "IntermediatePublishResult.andThen()", "constructor": false, "full_signature": "public Optional<Runnable> andThen()", "identifier": "andThen", "invocations": [ "ofNullable" ...
{ "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_70
{ "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 testFetchByIdNotFound() {\n UUID id = UUID.randomUUID();\n when(blockingStub.fetchById(eq(conv.toProto(id)))).thenReturn(conv.toProto(Optional\n .empty()));\n Optional<Fact> fetchById = uut.fetchById(id);\n assertFalse(fetchById.isPresent());\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 Optional<Fact> fetchById(UUID id) {\n log.trace(\"fetching {} from remote store\", id);\n\n MSG_OptionalFact fetchById;\n try {\n fetchById = blockingStub.fetchById(converter.toProto(id));\n } catch (StatusRuntimeException e) {\n throw...
{ "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_217
{ "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 testInvalidate() throws Exception {\n\n {\n UUID id = UUID.randomUUID();\n MSG_UUID req = conv.toProto(id);\n StreamObserver o = mock(StreamObserver.class);\n uut.invalidate(req, o);\n\n verify(backend).invalidate(eq(new S...
{ "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 invalidate(MSG_UUID request, StreamObserver<MSG_Empty> responseObserver) {\n try {\n UUID tokenId = converter.fromProto(request);\n store.invalidate(new StateToken(tokenId));\n responseObserver.onNext(MSG_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_66
{ "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 testFailOnUnknownType() {\n uut.onNext(MSG_Notification.newBuilder().setTypeValue(999).build());\n verify(subscription).notifyError(any(RuntimeException.class));\n }", "class_method_signature": "ClientStreamObserverTest.testFailOnUnknownType()", "constructor": f...
{ "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_128
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/IdOnlyFactTest.java", "identifier": "IdOnlyFactTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testType() {\n Assertions.assertThrows(UnsupportedOperationException.class, () -> {\n new IdOnlyFact(UUID.randomUUID()).type();\n });\n }", "class_method_signature": "IdOnlyFactTest.testType()", "constructor": false, "full_signature": "@Test void testType()...
{ "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 type() {\n throw new UnsupportedOperationException();\n }", "class_method_signature": "IdOnlyFact.type()", "constructor": false, "full_signature": "@Override public String type()", "identifier": "type", "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_89
{ "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 testIncompatibleProtocolVersion() {\n when(blockingStub.handshake(any()))\n .thenReturn(conv.toProto(ServerConfig.of(ProtocolVersion.of(99, 0, 0),\n new HashMap<>())));\n Assertions.assertThrows(IncompatibleProtocolVersions.class, () -> uu...
{ "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": "public synchronized void initialize() {\n if (!initialized.getAndSet(true)) {\n log.debug(\"Invoking handshake\");\n Map<String, String> serverProperties;\n ProtocolVersion serverProtocolVersion;\n try {\n ServerConfig cfg = converter.fromPr...
{ "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_201
{ "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 testPublishNull() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n uut.publish(null, mock(StreamObserver.class));\n });\n }", "class_method_signature": "FactStoreGrpcServiceTest.testPublishNull()", "constructor": false, "full_signature": "@...
{ "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_190
{ "fields": [], "file": "factcast-core/src/test/java/org/factcast/core/subscription/FluentSubscriptionRequestTest.java", "identifier": "FluentSubscriptionRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testToString() {\n SubscriptionRequest r = SubscriptionRequest.catchup(FactSpec.ns(\"foo\")).fromScratch();\n assertSame(r.debugInfo(), r.toString());\n }", "class_method_signature": "FluentSubscriptionRequestTest.testToString()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "ephemeral = false", "modifier": "", "original_string": "boolean ephemeral = false;", "type": "boolean", "var_name": "ephemeral" }, { "declarator": "marks = true", "modifier": "", "original_string": "boolean marks = true;", ...
{ "body": "@Override\n public String toString() {\n return debugInfo;\n }", "class_method_signature": "FluentSubscriptionRequest.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [], "modifiers": "@Override 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" }