Page page = new TestPage();
mapperContext.getPageManager().touchPage(page);
mapperContext.getPageManager().commitRequest();
// by cleaning session cache we make sure of not being testing the same in-memory instance
mapperContext.cleanSessionCache();
PageProvider provider = new PageProvider(page.getPageId(), MockPageWithLink.class, 0);
assertFalse(provider.hasPageInstance());
assertEquals(MockPageWithLink.class, provider.getPageInstance().getClass());
assertTrue(provider.isPageInstanceFresh());