PartEffectivityResource { @DELETE @ApiOperation(value = "Delete effectivity from given part revision", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of effectivity"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{effectivityId}") @Produces(MediaType.APPLICATION_JSON) public Response deleteEffectivity( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Part revision number") @PathParam("partNumber") String partNumber, @ApiParam(required = true, value = "Part revision version") @PathParam("partVersion") String partVersion, @ApiParam(required = true, value = "Effectivity id") @PathParam("effectivityId") int effectivityId) throws EntityNotFoundException, UserNotActiveException, AccessRightException, WorkspaceNotEnabledException { effectivityManager.deleteEffectivity(workspaceId, partNumber, partVersion, effectivityId); return Response.noContent().build(); } PartEffectivityResource(); @PostConstruct void init(); @POST @ApiOperation(value = "Create an Effectivity for a given PartRevision", response = EffectivityDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of created effectivity"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) EffectivityDTO createEffectivity(
            @ApiParam(required = true, value = "Effectivity to create") EffectivityDTO effectivity,
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Part revision number") @PathParam("partNumber") String partNumber,
            @ApiParam(required = true, value = "Part revision version") @PathParam("partVersion") String partVersion); @GET @ApiOperation(value = "Get effectivities of a given PartRevision", response = EffectivityDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of effectivities. It can be an empty list"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) Response getEffectivities(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Part revision number") @PathParam("partNumber") String partNumber,
            @ApiParam(required = true, value = "Part revision version") @PathParam("partVersion") String partVersion); @DELETE @ApiOperation(value = "Delete effectivity from given part revision", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of effectivity"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{effectivityId}") @Produces(MediaType.APPLICATION_JSON) Response deleteEffectivity(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Part revision number") @PathParam("partNumber") String partNumber,
            @ApiParam(required = true, value = "Part revision version") @PathParam("partVersion") String partVersion,
            @ApiParam(required = true, value = "Effectivity id") @PathParam("effectivityId") int effectivityId);  }
@Test public void deleteEffectivityTest() throws ApplicationException { int effectivityId = 42; Mockito.doNothing().when(effectivityManager) .deleteEffectivity(workspaceId, partNumber, partVersion, effectivityId); Response response = partEffectivityResource.deleteEffectivity(workspaceId, partNumber, partVersion, effectivityId); Assert.assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); }