@Test public void deleteProductBaselineTest() throws ApplicationException { Response response = productBaselineResource.deleteProductBaseline(workspaceId, ciId, baseline.getId()); Assert.assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); Mockito.verify(productBaselineService, times(1)).deleteBaseline(workspaceId, baseline.getId()); }
@DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) public Response deleteProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { productBaselineService.deleteBaseline(workspaceId, baselineId); return Response.noContent().build(); }
ProductBaselinesResource { @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) public Response deleteProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { productBaselineService.deleteBaseline(workspaceId, baselineId); return Response.noContent().build(); } }
ProductBaselinesResource { @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) public Response deleteProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { productBaselineService.deleteBaseline(workspaceId, baselineId); return Response.noContent().build(); } ProductBaselinesResource(); }
ProductBaselinesResource { @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) public Response deleteProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { productBaselineService.deleteBaseline(workspaceId, baselineId); return Response.noContent().build(); } ProductBaselinesResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get product-baselines in given workspace", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. 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 getAllProductBaselines(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @Path("{ciId}/baselines") @ApiOperation(value = "Get product-baseline with given configuration item", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. 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 getProductBaselinesForProduct(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId); @POST @ApiOperation(value = "Create a new product-baseline", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO createProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Product baseline to create") ProductBaselineCreationDTO productBaselineDTO,
            @ApiParam(required = false, value = "Dry run flag") @QueryParam("dryRun") boolean dryRun); @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) Response deleteProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO getProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's baselined parts", response = BaselinedPartDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of BaselinedPartDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/parts") @Produces(MediaType.APPLICATION_JSON) Response getProductBaselineParts(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Query") @QueryParam("q") String q); @GET @ApiOperation(value = "Get product-baseline's path-to-path links", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links-types") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkTypesInBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's path-to-path links for given source and target", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links/source/{sourcePath}/target/{targetPath}") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkInProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String configurationItemId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Source path") @PathParam("sourcePath") String sourcePathAsString,
            @ApiParam(required = true, value = "Target path") @PathParam("targetPath") String targetPathAsString); }
ProductBaselinesResource { @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) public Response deleteProductBaseline( @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId, @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId, @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId) throws EntityNotFoundException, AccessRightException, UserNotActiveException, EntityConstraintException, WorkspaceNotEnabledException { productBaselineService.deleteBaseline(workspaceId, baselineId); return Response.noContent().build(); } ProductBaselinesResource(); @PostConstruct void init(); @GET @ApiOperation(value = "Get product-baselines in given workspace", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. 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 getAllProductBaselines(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId); @GET @Path("{ciId}/baselines") @ApiOperation(value = "Get product-baseline with given configuration item", response = ProductBaselineDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTOs. 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 getProductBaselinesForProduct(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId); @POST @ApiOperation(value = "Create a new product-baseline", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO createProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Product baseline to create") ProductBaselineCreationDTO productBaselineDTO,
            @ApiParam(required = false, value = "Dry run flag") @QueryParam("dryRun") boolean dryRun); @DELETE @ApiOperation(value = "Delete product-baseline", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 204, message = "Successful deletion of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Consumes(MediaType.APPLICATION_JSON) Response deleteProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline by id", response = ProductBaselineDTO.class) @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of ProductBaselineDTO"), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}") @Produces(MediaType.APPLICATION_JSON) ProductBaselineDTO getProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's baselined parts", response = BaselinedPartDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of BaselinedPartDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/parts") @Produces(MediaType.APPLICATION_JSON) Response getProductBaselineParts(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Query") @QueryParam("q") String q); @GET @ApiOperation(value = "Get product-baseline's path-to-path links", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links-types") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkTypesInBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String ciId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId); @GET @ApiOperation(value = "Get product-baseline's path-to-path links for given source and target", response = LightPathToPathLinkDTO.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of LightPathToPathLinkDTOs. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 403, message = "Forbidden"), @ApiResponse(code = 500, message = "Internal server error") }) @Path("{ciId}/baselines/{baselineId}/path-to-path-links/source/{sourcePath}/target/{targetPath}") @Produces(MediaType.APPLICATION_JSON) Response getPathToPathLinkInProductBaseline(
            @ApiParam(required = true, value = "Workspace id") @PathParam("workspaceId") String workspaceId,
            @ApiParam(required = true, value = "Configuration item id") @PathParam("ciId") String configurationItemId,
            @ApiParam(required = true, value = "Baseline id") @PathParam("baselineId") int baselineId,
            @ApiParam(required = true, value = "Source path") @PathParam("sourcePath") String sourcePathAsString,
            @ApiParam(required = true, value = "Target path") @PathParam("targetPath") String targetPathAsString);  }