use of com.alibaba.graphscope.groot.coordinator.LocalSnapshotListener in project GraphScope by alibaba.
the class LocalSnapshotListenerTest method testListener.
@Test
void testListener() {
SchemaManager schemaManager = mock(SchemaManager.class);
GraphDef graphDef = GraphDef.newBuilder().setVersion(3L).build();
when(schemaManager.getGraphDef()).thenReturn(graphDef);
SnapshotCache snapshotCache = mock(SnapshotCache.class);
LocalSnapshotListener listener = new LocalSnapshotListener(schemaManager, snapshotCache);
listener.snapshotAdvanced(10L, 10L);
verify(snapshotCache).advanceQuerySnapshotId(eq(10L), eq(graphDef));
listener.snapshotAdvanced(20L, 10L);
verify(snapshotCache).advanceQuerySnapshotId(eq(20L), isNull());
}
Aggregations