ProductResource { @ApiOperation(notes = "Retrieves a single Product", value = "getProduct") @ApiResponses({ @ApiResponse(code = 404, message = "") }) @GET @Path("/{product_uuid}") @Produces(MediaType.APPLICATION_JSON) @SecurityHole public ProductDTO getProduct(@PathParam("product_uuid") String productUuid) { Product product = this.fetchProduct(productUuid); return this.translator.translate(product, ProductDTO.class); } @Inject  ProductResource(ProductCurator productCurator, OwnerCurator ownerCurator,
        ProductCertificateCurator productCertCurator, Configuration config, I18n i18n,
        ModelTranslator translator, JobManager jobManager); @ApiOperation(notes = "Retrieves a single Product", value = "getProduct") @ApiResponses({ @ApiResponse(code = 404, message = "") }) @GET @Path("/{product_uuid}") @Produces(MediaType.APPLICATION_JSON) @SecurityHole ProductDTO getProduct(@PathParam("product_uuid") String productUuid); @ApiOperation(notes = "Retreives a Certificate for a Product", value = "getProductCertificate") @ApiResponses({ @ApiResponse(code = 404, message = "") }) @GET @Path("/{product_uuid}/certificate") @Produces(MediaType.APPLICATION_JSON) @SecurityHole ProductCertificateDTO getProductCertificate(
        @PathParam("product_uuid") String productUuid); @ApiOperation(notes = "Creates a Product. Returns either the new created " + "Product or the Product that already existed. @deprecated Use per-org" + " version", value = "createProduct") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Deprecated ProductDTO createProduct(ProductDTO product); @ApiOperation(notes = "Updates a Product @deprecated Use per-org version", value = "updateProduct") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @PUT @Path("/{product_uuid}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.WILDCARD) @Deprecated ProductDTO updateProduct(
        @PathParam("product_uuid") String productUuid,
        @ApiParam(name = "product", required = true) ProductDTO product); @ApiOperation(notes = "Adds Content to a Product Batch mode @deprecated Use per-org version", value = "addBatchContent") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("/{product_uuid}/batch_content") @Deprecated ProductDTO addBatchContent(
        @PathParam("product_uuid") String productUuid,
        Map<String, Boolean> contentMap); @ApiOperation(notes = "Adds Content to a Product. Single mode @deprecated Use " + "per-org version", value = "addContent") @ApiResponses({ }) @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.WILDCARD) @Path("/{product_uuid}/content/{content_id}") @Deprecated ProductDTO addContent(
        @PathParam("product_uuid") String productUuid,
        @PathParam("content_id") String contentId,
        @QueryParam("enabled") Boolean enabled); @ApiOperation(notes = "Removes Content from a Product @deprecated Use per-org version", value = "removeContent") @DELETE @Produces(MediaType.APPLICATION_JSON) @Path("/{product_uuid}/content/{content_id}") @Deprecated void removeContent(
        @PathParam("product_uuid") String productUuid,
        @PathParam("content_id") String contentId); @ApiOperation(notes = "Removes a Product @deprecated Use per-org version", value = "deleteProduct") @ApiResponses({ @ApiResponse(code = 400, message = ""), @ApiResponse(code = 404, message = "") }) @DELETE @Produces(MediaType.APPLICATION_JSON) @Path("/{product_uuid}") @Deprecated void deleteProduct(
        @PathParam("product_uuid") String productUuid); @ApiOperation(notes = "Retrieves a list of Owners by Product", value = "getProductOwners", response = OwnerDTO.class, responseContainer = "list") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @GET @Path("/owners") @Produces(MediaType.APPLICATION_JSON) CandlepinQuery<OwnerDTO> getProductOwners(
        @ApiParam(value = "Multiple product UUIDs", required = true)
        @QueryParam("product") List<String> productUuids); @ApiOperation(notes = "Refreshes Pools by Product", value = "refreshPoolsForProduct", response = AsyncJobStatusDTO.class, responseContainer = "List") @PUT @Path("/subscriptions") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.WILDCARD) Stream<AsyncJobStatusDTO> refreshPoolsForProduct(
        @ApiParam(value = "Multiple product UUIDs", required = true)
        @QueryParam("product") List<String> productUuids,
        @QueryParam("lazy_regen") @DefaultValue("true") Boolean lazyRegen);  }
@Test public void getProduct() { Owner owner = this.createOwner("Example-Corporation"); Product entity = this.createProduct("test_product", "test_product", owner); ProductDTO expected = this.modelTranslator.translate(entity, ProductDTO.class); if (entity.isLocked()) { throw new RuntimeException("entity is locked...?"); } securityInterceptor.enable(); ProductDTO result = productResource.getProduct(entity.getUuid()); assertNotNull(result); assertEquals(result, expected); }