use of com.alibaba.graphscope.groot.coordinator.IngestProgressService in project GraphScope by alibaba.
the class IngestProgressServiceTest method testIngestProgressService.
@Test
void testIngestProgressService() {
SnapshotManager snapshotManager = mock(SnapshotManager.class);
when(snapshotManager.getTailOffsets(Arrays.asList(1))).thenReturn(Arrays.asList(10L));
IngestProgressService ingestProgressService = new IngestProgressService(snapshotManager);
GetTailOffsetsRequest request = GetTailOffsetsRequest.newBuilder().addQueueId(1).build();
ingestProgressService.getTailOffsets(request, new StreamObserver<GetTailOffsetsResponse>() {
@Override
public void onNext(GetTailOffsetsResponse response) {
List<Long> offsetsList = response.getOffsetsList();
assertEquals(offsetsList.size(), 1);
assertEquals(offsetsList.get(0), 10L);
}
@Override
public void onError(Throwable t) {
throw new RuntimeException(t);
}
@Override
public void onCompleted() {
}
});
verify(snapshotManager).getTailOffsets(Arrays.asList(1));
}
Aggregations