@Test @Order(3) public void testFindByIdNotFound() { given() .pathParam("id", 99L) .when().get("/{id}") .then() .statusCode(404); }
@GET @Path("{id}") @Produces("application/json") public Employee get(@PathParam("id") long id) { return service.get(id) .orElseThrow(() -> new WebApplicationException(404)); }
EmployeeResource { @GET @Path("{id}") @Produces("application/json") public Employee get(@PathParam("id") long id) { return service.get(id) .orElseThrow(() -> new WebApplicationException(404)); } }
EmployeeResource { @GET @Path("{id}") @Produces("application/json") public Employee get(@PathParam("id") long id) { return service.get(id) .orElseThrow(() -> new WebApplicationException(404)); }  }
EmployeeResource { @GET @Path("{id}") @Produces("application/json") public Employee get(@PathParam("id") long id) { return service.get(id) .orElseThrow(() -> new WebApplicationException(404)); }  @GET @Path("all") @Produces("application/json") List<Employee> getAll(); @GET @Path("{id}") @Produces("application/json") Employee get(@PathParam("id") long id); @POST Response register(@QueryParam("name") String name, @Context UriInfo uriInfo); @DELETE @Path("{id}") Response resign(@PathParam("id") long id); }
EmployeeResource { @GET @Path("{id}") @Produces("application/json") public Employee get(@PathParam("id") long id) { return service.get(id) .orElseThrow(() -> new WebApplicationException(404)); }  @GET @Path("all") @Produces("application/json") List<Employee> getAll(); @GET @Path("{id}") @Produces("application/json") Employee get(@PathParam("id") long id); @POST Response register(@QueryParam("name") String name, @Context UriInfo uriInfo); @DELETE @Path("{id}") Response resign(@PathParam("id") long id);  }