### Question:
DefaultPageService implements PageService { @Override public List<Page> getAllUserPages(String userId) { return pageRepository.getAllPagesForUserType(userId, PageType.USER.toString()); } @Autowired  DefaultPageService(PageRepository pageRepository,
                              PageTemplateRepository pageTemplateRepository,
                              RegionRepository regionRepository,
                              WidgetRepository widgetRepository,
                              RegionWidgetRepository regionWidgetRepository,
                              PageLayoutRepository pageLayoutRepository,
                              UserService userService,
                              @Value("${portal.page.default_name}") String defaultPageName); @Override SearchResult<Page> getAll(); @Override SearchResult<Page> getLimited(int offset, int limit); @Override Page getPage(String pageId); @Override List<Page> getAllUserPages(String userId); @Override @Transactional Page getPersonProfilePage(String userId); @Override List<Page> getPages(String context, String contextId); @Override Page getPageFromList(String pageId, List<Page> pages); @Override Page getDefaultPageFromList(List<Page> pages); @Override @Transactional Page addNewPage(String pageName, String contextId, String pageTemplateId); @Override @Transactional Page addNewUserPage(String pageName, String pageLayoutCode); @Override @Transactional Page addNewDefaultUserPage(String userId); @Override @Transactional Page addNewSubPage(String pageName, String pageLayoutCode, Page parentPage); @Override String getDefaultPageName(); @Override @Transactional void deletePage(String pageId); @Override @Transactional int deletePages(String userId, String pageType); @Override @Transactional RegionWidget moveRegionWidget(String regionWidgetId, int newPosition, String toRegionId, String fromRegionId); @Override @Transactional RegionWidget moveRegionWidgetToPage(String regionWidgetId, String toPageId); @Override @Transactional Region removeWidgetFromPage(String regionWidgetId); @Override @Transactional RegionWidget addWidgetToPage(String pageId, String widgetId); @Override @Transactional RegionWidget addWidgetToPageRegion(String pageId, String widgetId, String regionId); @Override @Transactional Page movePage(String pageId, String moveAfterPageId); @Override @Transactional Page movePageToDefault(String pageId); @Override @Transactional Page updatePage(String pageId, String name, String pageLayoutCode); @Override @Transactional Page updatePage(String pageId, String name, String pageLayoutCode, Map<String, Object> properties); @Override @Transactional Page clonePageForUser(String pageId, String userId, String pageName); @Transactional Boolean addMemberToPage(String pageId, String userId); @Transactional Boolean removeMemberFromPage(String pageId, String userId); @Override @Transactional Boolean updateSharedPageStatus(String pageId, String shareStatus); @Override @Transactional Boolean updateSharedPageStatus(String pageId, String userId, String shareStatus); @Override @Transactional Boolean updatePageEditingStatus(String pageId, String userId, boolean isEditor);  }### Answer:
@Test public void getAllUserPages() { final List<Page> VALID_PAGES = new ArrayList<Page>(); expect(pageRepository.getAllPagesForUserType(VALID_USER_ID, PageType.USER.toString())).andReturn(VALID_PAGES); replay(pageRepository); assertThat(pageService.getAllUserPages(VALID_USER_ID), sameInstance(VALID_PAGES)); verify(pageRepository); }