use of io.atomix.core.map.impl.AtomicCounterMapService in project atomix by atomix.
the class AtomicCounterMapServiceTest method testSnapshot.
@Test
public void testSnapshot() throws Exception {
AtomicCounterMapService service = new AtomicCounterMapService();
service.put(new DefaultCommit<>(2, PUT, new Put("foo", 1), mock(Session.class), System.currentTimeMillis()));
Buffer buffer = HeapBuffer.allocate();
service.backup(buffer);
service = new AtomicCounterMapService();
service.restore(buffer.flip());
long value = service.get(new DefaultCommit<>(2, GET, new Get("foo"), mock(Session.class), System.currentTimeMillis()));
assertEquals(1, value);
}
Aggregations