### Question:
TodoGatewayResource { @GET @Path("/{id}") public Response getTodo(@PathParam("id") final Long todoId) { LOG.info("Request todo with id {}", todoId); Response response = repository.getTodo(todoId); return Response.fromResponse(response).build(); }  @POST Response createTodo(final String newTodo); @DELETE @Path("/{id}") Response deleteTodo(@PathParam("id") final Long todoId); @GET @Path("/{id}") Response getTodo(@PathParam("id") final Long todoId); @GET @Operation(description = "Find all todos") Response getTodos(); @PUT @Path("/{id}") Response updateTodo(@PathParam("id") final Long todoId, final String modifiedTodo);  }### Answer:
@Test public void getTodo() { Mockito.when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode()); Mockito.when(response.getEntity()).thenReturn("{\n" + " \"id\": 1000,\n" + " \"title\": \"clean fridge\",\n" + " \"description\": \"It's a mess\",\n" + " \"dueDate\": \"2018-01-01T12:34:56Z\"\n" + " \"done\": false\n" + "}"); Mockito.when(service.getTodo(Mockito.anyLong())).thenReturn(response); Response response = resource.getTodo(1L); assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode()); assertThat(response.getEntity()).isEqualTo("{\n" + " \"id\": 1000,\n" + " \"title\": \"clean fridge\",\n" + " \"description\": \"It's a mess\",\n" + " \"dueDate\": \"2018-01-01T12:34:56Z\"\n" + " \"done\": false\n" + "}"); Mockito.verify(service).getTodo(Mockito.anyLong()); Mockito.verifyNoMoreInteractions(service); }