@Override
public Page answer() throws Throwable {
return (Page)EasyMock.getCurrentArguments()[0];
}
});
expect(pageTemplateRepository.getDefaultPage(PageType.USER)).andThrow(new NonUniqueResultException("Non-Unique Result Exception"));
expect(pageRepository.getAllPages(user.getId(), PageType.USER)).andReturn(new ArrayList<Page>());
replay(userService, pageLayoutRepository, pageRepository, pageTemplateRepository);
Page newPage = pageService.addNewUserPage(PAGE_NAME, PAGE_LAYOUT_CODE);