### Question:
ReadPostsController { @ResponseBody @RequestMapping("/topics/{topicId}/page/{pageNum}/markread") public String markTopicPageAsReadById(@PathVariable long topicId, @PathVariable int pageNum) throws NotFoundException { Topic topic = topicService.get(topicId); lastReadPostService.markTopicPageAsRead(topic, pageNum); return ""; } @Autowired  ReadPostsController(BranchService branchService, LastReadPostService lastReadPostService,
                               RetryTemplate retryTemplate, TopicFetchService topicService); @RequestMapping(value = "/recent/forum/markread", method = RequestMethod.GET) String markAllForumAsReadFromRecentActivity(); @RequestMapping(value = "/main/forum/markread", method = RequestMethod.GET) String markAllForumAsReadFromMainPage(); @RequestMapping("/branches/{id}/markread") String markAllTopicsAsRead(@PathVariable long id); @ResponseBody @RequestMapping("/topics/{topicId}/page/{pageNum}/markread") String markTopicPageAsReadById(@PathVariable long topicId,
                                          @PathVariable int pageNum);  }### Answer:
@Test public void markTopicAsReadByIdShouldMarkItAsRead() throws NotFoundException { Topic topicToRead = new Topic(); when(topicFetchService.get(1L)).thenReturn(topicToRead); controller.markTopicPageAsReadById(1L, 10); verify(lastReadPostService).markTopicPageAsRead(topicToRead, 10); }