### Question:
LeaderBoardController { @GetMapping public List<LeaderBoardRow> getLeaderBoard() { return leaderBoardService.getCurrentLeaderBoard(); } LeaderBoardController(final LeaderBoardService leaderBoardService); @GetMapping List<LeaderBoardRow> getLeaderBoard();  }### Answer:
@Test public void getLeaderBoardTest() throws Exception{ LeaderBoardRow leaderBoardRow1 = new LeaderBoardRow(1L, 500L); LeaderBoardRow leaderBoardRow2 = new LeaderBoardRow(2L, 400L); List<LeaderBoardRow> leaderBoard = new ArrayList<>(); Collections.addAll(leaderBoard, leaderBoardRow1, leaderBoardRow2); given(leaderBoardService.getCurrentLeaderBoard()).willReturn(leaderBoard); MockHttpServletResponse response = mvc.perform( get("/leaders") .accept(MediaType.APPLICATION_JSON)) .andReturn().getResponse(); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(response.getContentAsString()) .isEqualTo(json.write(leaderBoard).getJson()); }