use of io.atomix.core.tree.impl.DocumentTreeOperations.GET in project atomix by atomix.
the class DocumentTreeServiceTest method testSnapshot.
private void testSnapshot(Ordering ordering) throws Exception {
DocumentTreeService service = new DocumentTreeService(ordering);
service.update(new DefaultCommit<>(2, UPDATE, new Update(DocumentPath.from("root|foo"), Optional.of("Hello world!".getBytes()), Match.any(), Match.ifNull()), mock(Session.class), System.currentTimeMillis()));
Buffer buffer = HeapBuffer.allocate();
service.backup(buffer);
service = new DocumentTreeService(ordering);
service.restore(buffer.flip());
Versioned<byte[]> value = service.get(new DefaultCommit<>(2, GET, new Get(DocumentPath.from("root|foo")), mock(Session.class), System.currentTimeMillis()));
assertNotNull(value);
assertArrayEquals("Hello world!".getBytes(), value.value());
}
Aggregations