### Question:
BranchController { @RequestMapping("/topics/recent") public ModelAndView recentTopicsPage( @RequestParam(value = PAGE, defaultValue = "1", required = false) String page) { Page<Topic> topicsPage = topicFetchService.getRecentTopics(page); lastReadPostService.fillLastReadPostForTopics(topicsPage.getContent()); return new ModelAndView("topic/recent") .addObject("topicsPage", converter.convertTopicPageToTopicDtoPage(topicsPage)) .addObject("topics", topicsPage.getContent()); } @Autowired  BranchController(BranchService branchService,
                            TopicFetchService topicFetchService,
                            LastReadPostService lastReadPostService,
                            UserService userService,
                            BreadcrumbBuilder breadcrumbBuilder,
                            LocationService locationService,
                            PostService postService,
                            PermissionEvaluator aclEvaluator,
                            SecurityContextFacade securityContextFacade,
                            PluginLoader pluginLoader,
                            EntityToDtoConverter converter); @RequestMapping(value = "/branches/{branchId}", method = RequestMethod.GET) ModelAndView showPage(@PathVariable("branchId") long branchId,
                                 @RequestParam(value = PAGE, defaultValue = "1", required = false) String page
    ); @RequestMapping("/branches/{branchId}/recent") ModelAndView recentBranchPostsPage(@PathVariable("branchId") long branchId); @RequestMapping("/topics/recent") ModelAndView recentTopicsPage(
            @RequestParam(value = PAGE, defaultValue = "1", required = false) String page); @RequestMapping("/topics/unanswered") ModelAndView unansweredTopicsPage(@RequestParam(value = PAGE, defaultValue = "1", required = false)
                                             String page); @RequestMapping("/branches/json/{currentTopicId}/{sectionId}") @ResponseBody BranchDto[] getBranchesFromSection(@PathVariable("currentTopicId") long currentTopicId,
                                              @PathVariable("sectionId") long sectionId); @RequestMapping("/branches/json/{currentTopicId}") @ResponseBody BranchDto[] getAllBranches(@PathVariable("currentTopicId") long currentTopicId); static final String PAGE; }### Answer:
@Test public void recentTopicsPage() throws NotFoundException { String page = "1"; Page<Topic> topicsPage = new PageImpl<>(new ArrayList<Topic>()); Page<TopicDto> dtoPage = new PageImpl<>(new ArrayList<TopicDto>()); when(topicFetchService.getRecentTopics(page)).thenReturn(topicsPage); when(converter.convertTopicPageToTopicDtoPage(topicsPage)).thenReturn(dtoPage); ModelAndView mav = controller.recentTopicsPage(page); verify(topicFetchService).getRecentTopics(page); assertViewName(mav, "topic/recent"); assertAndReturnModelAttributeOfType(mav, "topicsPage", Page.class); assertAndReturnModelAttributeOfType(mav, "topics", List.class); }