### Question:
CoffeeResource { @Path("/{id}") @GET public Response coffeeDetail(@PathParam int id) { final Long invocationNumber = counter.getAndIncrement(); maybeFail(String.format("CoffeeResource#coffees() invocation #%d failed", invocationNumber)); LOGGER.infof("CoffeeResource#coffees() invocation #%d returning successfully", invocationNumber); Coffee coffee = coffeeRepository.getCoffeeById(id); if (coffee == null) { return Response.status(Response.Status.NOT_FOUND).build(); } return Response.ok(coffee).build(); }  @GET @Retry(maxRetries = 4, retryOn = RuntimeException.class) List<Coffee> coffees(); @Path("/{id}") @GET Response coffeeDetail(@PathParam int id); @Path("/{id}/availability") @GET Response availability(@PathParam int id); @GET @Path("/{id}/recommendations") @Timeout(250) @Fallback(fallbackMethod = "fallbackRecommendations") List<Coffee> recommendations(@PathParam int id); List<Coffee> fallbackRecommendations(int id);  }### Answer:
@Test public void testCoffeeDetail() { coffeeResource.setFailRatio(0f); get("/coffee/1") .then() .statusCode(200) .body("id", is(1)) .body("countryOfOrigin", is("Colombia")); coffeeResource.setFailRatio(1f); get("/coffee/1") .then() .statusCode(500); }