### Question:
EndpointResource extends AbstractEndpointResource { @DELETE @Path("/{endpointID}") @PathAuthorizer(type = ResourceType.Endpoint, pathParam = "endpointID") @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Delete an Endpoint", notes = "Delete an Endpoint resource") @ApiResponses(value = { @ApiResponse(code = 200, message = "Endpoint deleted"), @ApiResponse(code = 404, message = "Endpoint not found"), @ApiResponse(code = 422, message = "Endpoint cannot be deleted") }) @Override public Response deleteEndpoint(@NotNull @PathParam("endpointID") UUID endpointID) { this.client .delete() .resourceById("Endpoint", endpointID.toString()) .execute(); return Response.ok().build(); } @Inject  EndpointResource(@Named("attribution") IGenericClient client); @POST @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Create an Endpoint", notes = "Create an Endpoint resource for an Organization") @ApiResponses(value = { @ApiResponse(code = 204, message = "Endpoint created"), @ApiResponse(code = 400, message = "Bad request"), @ApiResponse(code = 422, message = "Endpoint not valid") }) @Override Response createEndpoint(@ApiParam(hidden = true) @Auth OrganizationPrincipal organizationPrincipal,
                                   @ApiParam @Valid @Profiled(profile = EndpointProfile.PROFILE_URI) Endpoint endpoint); @GET @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Search for Endpoints", notes = "Search for Endpoint resources associated to the given Organization.") @Override Bundle getEndpoints(@ApiParam(hidden=true) @Auth OrganizationPrincipal organization); @GET @Path("/{endpointID}") @PathAuthorizer(type = ResourceType.Endpoint, pathParam = "endpointID") @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Fetch Endpoint resource", notes = "Fetch a specific Endpoint associated to an Organization.") @ApiResponses(@ApiResponse(code = 404, message = "Endpoint not found")) @Override Endpoint fetchEndpoint(@ApiParam @PathParam("endpointID") @NotNull UUID endpointID); @PUT @Path("/{endpointID}") @PathAuthorizer(type = ResourceType.Endpoint, pathParam = "endpointID") @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Update an Organization's FHIR Server Endpoint", notes = "Update an Endpoint resource") @ApiResponses(value = { @ApiResponse(code = 200, message = "Endpoint updated"), @ApiResponse(code = 404, message = "Endpoint not found"), @ApiResponse(code = 422, message = "Endpoint not valid") }) @Override Endpoint updateEndpoint(@ApiParam(value = "Your Organization's FHIR Endpoint ID") @NotNull @PathParam("endpointID") UUID endpointID,
                                   @Valid @Profiled(profile = EndpointProfile.PROFILE_URI) Endpoint endpoint); @DELETE @Path("/{endpointID}") @PathAuthorizer(type = ResourceType.Endpoint, pathParam = "endpointID") @FHIR @Timed @ExceptionMetered @ApiOperation(value = "Delete an Endpoint", notes = "Delete an Endpoint resource") @ApiResponses(value = { @ApiResponse(code = 200, message = "Endpoint deleted"), @ApiResponse(code = 404, message = "Endpoint not found"), @ApiResponse(code = 422, message = "Endpoint cannot be deleted") }) @Override Response deleteEndpoint(@NotNull @PathParam("endpointID") UUID endpointID);  }### Answer:
@Test void testDeleteEndpoint() { Endpoint endpoint = OrganizationFactory.createValidFakeEndpoint(); MethodOutcome createOutcome = client.create().resource(endpoint).execute(); Endpoint createdEndpoint = (Endpoint) createOutcome.getResource(); String endpointId = FHIRExtractors.getEntityUUID(createdEndpoint.getId()).toString(); client .delete() .resourceById("Endpoint", endpointId) .execute(); IReadExecutable readExec = client .read() .resource(Endpoint.class) .withId(endpointId); assertThrows(ResourceNotFoundException.class, readExec::execute); }