use of com.alibaba.graphscope.groot.ingestor.StoreWriteClient in project GraphScope by alibaba.
the class IngestorRpcTest method testStoreWriteClient.
@Test
void testStoreWriteClient() {
StoreWriteGrpc.StoreWriteStub stub = mock(StoreWriteGrpc.StoreWriteStub.class);
StoreWriteClient client = new StoreWriteClient(stub);
CompletionCallback callback = mock(CompletionCallback.class);
doAnswer(invocation -> {
StreamObserver<WriteStoreResponse> observer = invocation.getArgument(1);
observer.onNext(WriteStoreResponse.newBuilder().setSuccess(true).build());
return null;
}).when(stub).writeStore(any(), any());
client.writeStore(Arrays.asList(StoreDataBatch.newBuilder().requestId("test_req").build()), callback);
verify(callback).onCompleted(10);
}
Aggregations