ActivationKeyResource { @ApiOperation(notes = "Removes an Activation Key", value = "deleteActivationKey") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @DELETE @Path("{activation_key_id}") @Produces(MediaType.APPLICATION_JSON) public void deleteActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId) { ActivationKey key = this.fetchActivationKey(activationKeyId); log.debug("Deleting activation key: {}", activationKeyId); activationKeyCurator.delete(key); } @Inject  ActivationKeyResource(ActivationKeyCurator activationKeyCurator, I18n i18n,
        PoolManager poolManager, ServiceLevelValidator serviceLevelValidator,
        ActivationKeyRules activationKeyRules, OwnerProductCurator ownerProductCurator,
        ProductCachedSerializationModule productCachedModule, ModelTranslator translator); @ApiOperation(notes = "Retrieves a single Activation Key", value = "Get Activation Key") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @GET @Path("{activation_key_id}") @Produces(MediaType.APPLICATION_JSON) ActivationKeyDTO getActivationKey(
        @PathParam("activation_key_id")
        @Verify(ActivationKey.class) String activationKeyId); @ApiOperation(notes = "Retrieves a list of Pools based on the Activation Key", value = "Get Activation Key Pools", response = PoolDTO.class, responseContainer = "list") @ApiResponses({ @ApiResponse(code = 400, message = "")}) @GET @Path("{activation_key_id}/pools") @Produces(MediaType.APPLICATION_JSON) Iterator<PoolDTO> getActivationKeyPools(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId); @ApiOperation(notes = "Updates an Activation Key", value = "Update Activation Key") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @PUT @Path("{activation_key_id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) ActivationKeyDTO updateActivationKey(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId,
        @ApiParam(name = "update", required = true) ActivationKeyDTO update); @ApiOperation(notes = "Adds a Pool to an Activation Key", value = "Add Pool to Key") @ApiResponses({ @ApiResponse(code = 400, message = "")}) @POST @Path("{activation_key_id}/pools/{pool_id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.WILDCARD) ActivationKeyDTO addPoolToKey(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId,
        @PathParam("pool_id") @Verify(Pool.class) String poolId,
        @QueryParam("quantity") Long quantity); @ApiOperation(notes = "Removes a Pool from an Activation Key", value = "Remove Pool From Key") @ApiResponses({ @ApiResponse(code = 400, message = "")}) @DELETE @Path("{activation_key_id}/pools/{pool_id}") @Produces(MediaType.APPLICATION_JSON) ActivationKeyDTO removePoolFromKey(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId,
        @PathParam("pool_id")
        @Verify(Pool.class) String poolId); @ApiOperation(notes = "Adds an Product ID to an Activation Key", value = "Add Product ID to key") @ApiResponses({ @ApiResponse(code = 400, message = "")}) @POST @Path("{activation_key_id}/product/{product_id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.WILDCARD) ActivationKeyDTO addProductIdToKey(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId,
        @PathParam("product_id") String productId); @ApiOperation(notes = "Removes a Product ID from an Activation Key", value = "Remove Product Id from Key") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @DELETE @Path("{activation_key_id}/product/{product_id}") @Produces(MediaType.APPLICATION_JSON) ActivationKeyDTO removeProductIdFromKey(
        @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId,
        @PathParam("product_id") String productId); @ApiOperation(notes = "Retrieves a list of Activation Keys", value = "findActivationKey", response = ActivationKeyDTO.class, responseContainer = "list") @GET @Produces(MediaType.APPLICATION_JSON) CandlepinQuery<ActivationKeyDTO> findActivationKey(); @ApiOperation(notes = "Removes an Activation Key", value = "deleteActivationKey") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @DELETE @Path("{activation_key_id}") @Produces(MediaType.APPLICATION_JSON) void deleteActivationKey(
        @PathParam("activation_key_id")
        @Verify(ActivationKey.class) String activationKeyId);  }
@Test public void testInvalidTokenIdOnDelete() { assertThrows(BadRequestException.class, () -> activationKeyResource.deleteActivationKey("JarJarBinks") ); }