### Question:
PollController { @RequestMapping(value = "/poll/{pollId}/multiple", method = RequestMethod.POST) @ResponseBody public PollDto addMultipleVote(@PathVariable Long pollId, @RequestBody PollDto pollDto) { Poll poll = pollService.vote(pollId, pollDto.getPollOptionIds()); return new PollDto(poll); } @Autowired  PollController(PollService pollService); @RequestMapping(value = "/poll/{pollId}/single", method = RequestMethod.POST) @ResponseBody PollDto addSingleVote(@PathVariable Long pollId, @RequestParam Long pollOptionId); @RequestMapping(value = "/poll/{pollId}/multiple", method = RequestMethod.POST) @ResponseBody PollDto addMultipleVote(@PathVariable Long pollId, @RequestBody PollDto pollDto); @ExceptionHandler(AccessDeniedException.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) ModelAndView handleAllExceptions(Exception exception);  }### Answer:
@Test public void testAddMultipleVote() { long firstOptionId = 1; long secondOptionId = 2; List<Long> optionIds = Arrays.asList(firstOptionId, secondOptionId); Poll poll = createPoll(POLL_ID, optionIds); PollDto pollDto = new PollDto(poll); Mockito.when(pollService.vote(POLL_ID, optionIds)).thenReturn(poll); PollDto resultPollDto = pollController.addMultipleVote(POLL_ID, pollDto); Assert.assertEquals(resultPollDto.getId(), poll.getId(), "The id must be the same."); PollOptionDto firstOptionDto = resultPollDto.getPollOptions().get(0); Assert.assertEquals(firstOptionDto.getId(), firstOptionId, "The id must be the same"); PollOptionDto secondOptionDto = resultPollDto.getPollOptions().get(1); Assert.assertEquals(secondOptionDto.getId(), secondOptionId, "The id must be the same"); }