ContentResource { @ApiOperation(notes = "Updates a Content", value = "updateContent") @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{content_uuid}") public ContentDTO updateContent(@PathParam("content_uuid") String contentUuid, ContentDTO changes) { throw new BadRequestException(this.i18n.tr( "Organization-agnostic content write operations are not supported.")); } @Inject  ContentResource(ContentCurator contentCurator, I18n i18n, UniqueIdGenerator idGenerator,
        EnvironmentContentCurator envContentCurator, PoolManager poolManager,
        ProductCurator productCurator, OwnerCurator ownerCurator, ModelTranslator modelTranslator); @ApiOperation(notes = "Retrieves list of Content", value = "list", response = ContentDTO.class, responseContainer = "list") @GET @Produces(MediaType.APPLICATION_JSON) CandlepinQuery<ContentDTO> list(); @ApiOperation(notes = "Retrieves a single Content", value = "getContent") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{content_uuid}") ContentDTO getContent(@PathParam("content_uuid") String contentUuid); @ApiOperation(notes = "Creates a Content", value = "createContent") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) ContentDTO createContent(ContentDTO content); @ApiOperation(notes = "Creates Contents in bulk", value = "createBatchContent") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/batch") Iterable<ContentDTO> createBatchContent(List<ContentDTO> contents); @ApiOperation(notes = "Updates a Content", value = "updateContent") @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{content_uuid}") ContentDTO updateContent(@PathParam("content_uuid") String contentUuid, ContentDTO changes); @ApiOperation(notes = "Deletes a Content", value = "remove") @DELETE @Produces(MediaType.APPLICATION_JSON) @Path("/{content_uuid}") void remove(@PathParam("content_uuid") String contentUuid);  }
@Test(expected = BadRequestException.class) public void testUpdateContentNoLongerSupported() { final String contentId = "10"; ContentDTO contentDTO = mock(ContentDTO.class); cr.updateContent(contentId, contentDTO); verify(cc, never()).get(any()); verify(cc, never()).merge(any()); verify(productCurator, never()).getProductsByContent(any(), any()); }