### Question:
MultiplicationResultAttemptController { @GetMapping("/{resultId}") ResponseEntity<MultiplicationResultAttempt> getResultById(final @PathVariable("resultId") Long resultId) { return ResponseEntity.ok( multiplicationService.getResultById(resultId) ); } @Autowired  MultiplicationResultAttemptController(final MultiplicationService multiplicationService);   }### Answer:
@Test public void getResultByIdTest() throws Exception { User user = new User("john_doe"); Multiplication multiplication = new Multiplication(50, 70); MultiplicationResultAttempt attempt = new MultiplicationResultAttempt( user, multiplication, 3500, true); given(multiplicationService.getResultById(4L)).willReturn(attempt); MockHttpServletResponse response = mvc.perform( get("/results/4")) .andReturn().getResponse(); assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value()); assertThat(response.getContentAsString()).isEqualTo( jsonResultAttempt.write(attempt).getJson()); }