### Question:
TodoGatewayResource { @PUT @Path("/{id}") public Response updateTodo(@PathParam("id") final Long todoId, final String modifiedTodo) { LOG.info("Request updateTodo todo with id {} ({})", todoId, modifiedTodo); Response response = repository.updateTodo(todoId, modifiedTodo); 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 updateTodo() { Mockito.when(response.getStatus()).thenReturn(Response.Status.NO_CONTENT.getStatusCode()); Mockito.when(response.getEntity()).thenReturn(""); Mockito.when(service.updateTodo(Mockito.anyLong(), Mockito.anyString())).thenReturn(response); Response response = resource.updateTodo(1L, "{\n" + " \"title\": \"clean fridge\",\n" + " \"description\": \"It's a mess\",\n" + " \"dueDate\": \"2018-01-01T12:34:56Z\"\n" + " \"done\": true\n" + "}"); assertThat(response.getStatus()).isEqualTo(Response.Status.NO_CONTENT.getStatusCode()); assertThat(response.getEntity()).isEqualTo(""); Mockito.verify(service).updateTodo(Mockito.anyLong(), Mockito.anyString()); Mockito.verifyNoMoreInteractions(service); }