### Question:
ScoreController { @GetMapping("/{attemptId}") public ScoreCard getScoreForAttempt( @PathVariable("attemptId") final Long attemptId) { return gameService.getScoreForAttempt(attemptId); } ScoreController(final GameService gameService); @GetMapping("/{attemptId}") ScoreCard getScoreForAttempt(
            @PathVariable("attemptId") final Long attemptId);  }### Answer:
@Test public void getScoreForAttemptTest() throws Exception { ScoreCard scoreCard = new ScoreCard(1L, 5L, 10L, System.currentTimeMillis(), 100); given(gameService.getScoreForAttempt(10L)).willReturn(scoreCard); MockHttpServletResponse response = mvc.perform( get("/scores/10") .accept(MediaType.APPLICATION_JSON)) .andReturn().getResponse(); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(response.getContentAsString()) .isEqualTo(json.write(scoreCard).getJson()); }