RulesResource { @ApiOperation(notes = "Removes the Rules Deletes any uploaded rules, uses bundled rules instead", value = "delete") @DELETE @Produces(MediaType.APPLICATION_JSON) public void delete() { Rules deleteRules = rulesCurator.getRules(); rulesCurator.delete(deleteRules); log.warn("Deleting rules version: " + deleteRules.getVersion()); sink.emitRulesDeleted(deleteRules); jsProvider.compileRules(true); } @Inject  RulesResource(RulesCurator rulesCurator,
        I18n i18n, EventSink sink, JsRunnerProvider jsProvider); @ApiOperation(notes = "Uploads the Rules Returns a copy of the uploaded rules.", value = "upload") @ApiResponses({ @ApiResponse(code = 400, message = "") }) @POST @Consumes({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN }) @Produces({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON }) String upload(String rulesBuffer); @ApiOperation(notes = "Retrieves the Rules", value = "get") @ApiResponses({ @ApiResponse(code = 503, message = "") }) @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN }) String get(); @ApiOperation(notes = "Removes the Rules Deletes any uploaded rules, uses bundled rules instead", value = "delete") @DELETE @Produces(MediaType.APPLICATION_JSON) void delete();  }
@Test public void testDelete() { String origRules = rulesResource.get(); String rulesBuffer = new String(Base64.encodeBase64String(( TestUtil.createRulesBlob(10000).getBytes()))); rulesResource.upload(rulesBuffer); rulesResource.delete(); String rulesAfterDelete = rulesResource.get(); assertEquals(rulesAfterDelete, origRules); }