use of io.atomix.core.counter.impl.AtomicCounterOperations.Set in project atomix by atomix.
the class AtomicCounterServiceTest method testSnapshot.
@Test
public void testSnapshot() throws Exception {
AtomicCounterService service = new AtomicCounterService();
service.set(new DefaultCommit<>(2, SET, new Set(1L), mock(Session.class), System.currentTimeMillis()));
Buffer buffer = HeapBuffer.allocate();
service.backup(buffer);
service = new AtomicCounterService();
service.restore(buffer.flip());
long value = service.get(new DefaultCommit<>(2, GET, null, mock(Session.class), System.currentTimeMillis()));
assertEquals(1, value);
}
Aggregations