@Test
public void addNewUserPage_noExistingPages() {
final String PAGE_NAME = "my new page";
final Long EXPECTED_RENDER_SEQUENCE = 1L;
PageTemplate pageTemplate = new PageTemplateImpl() ;
Page expectedPage = new PageImpl();
expectedPage.setName(PAGE_NAME);
expectedPage.setOwnerId(user.getId());
expectedPage.setPageLayout(pageLayout);
expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
expectedPage.setPageType(PageType.USER);
PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
List<PageUser> members = new ArrayList<PageUser>();
members.add(lPageUser);
expectedPage.setMembers(members);
expect(userService.getAuthenticatedUser()).andReturn(user);
expect(pageLayoutRepository.getByPageLayoutCode(PAGE_LAYOUT_CODE)).andReturn(pageLayout);
expect(pageTemplateRepository.getDefaultPage(PageType.USER)).andReturn(pageTemplate);
expect(pageRepository.createPageForUser(user, pageTemplate)).andReturn(expectedPage);