TestSupportPageStore store = (TestSupportPageStore)managerImpl.getPageStore(new SimpleString("simple-test"));
ServerMessage msg = createMessage(1l, new SimpleString("simple-test"), createRandomBuffer(10));
Assert.assertFalse(store.page(msg, new RoutingContextImpl(null)));
store.startPaging();
Assert.assertTrue(store.page(msg, new RoutingContextImpl(null)));
Page page = store.depage();
page.open();
List<PagedMessage> msgs = page.read();
page.close();
Assert.assertEquals(1, msgs.size());
UnitTestCase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), msgs.get(0)
.getMessage()
.getBodyBuffer()
.toByteBuffer()
.array());
Assert.assertTrue(store.isPaging());
Assert.assertNull(store.depage());
Assert.assertFalse(store.page(msg, new RoutingContextImpl(null)));
}