layout.setCode(layoutCode);
//create a strict mock that ensures that the appropriate setters are
//called, rather than checking the return value from the function
Page curPage = createStrictMock(Page.class);
expect(curPage.getPageLayout()).andReturn(prevLayout);
expect(curPage.getRegions()).andReturn(regions);
expect(curPage.getId()).andReturn(PAGE_ID).anyTimes();
/*expect(curPage.getMembers()).andReturn(new ArrayList<PageUser>());
expect(curPage.getName()).andReturn(newName);
expect(curPage.getOwner()).andReturn(user);
expect(curPage.getPageLayout()).andReturn(layout);
expect(curPage.getPageType()).andReturn(PageType.USER);
expect(curPage.getParentPage()).andReturn(null);
expect(curPage.getRegions()).andReturn(regions);
expect(curPage.getSubPages()).andReturn(new ArrayList<Page>()); */
curPage.setName(newName);
expectLastCall();
curPage.setPageLayout(layout);
expectLastCall();
replay(curPage);
expect(pageRepository.get(PAGE_ID)).andReturn(curPage);
expect(pageRepository.save(curPage)).andReturn(curPage);