RaxaDrugController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Drug") @ResponseBody public Object retireDrug(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initDrugController(); Drug drug = service.getDrugByUuid(uuid); if (drug != null) { drug.setRetired(true); drug.setRetireReason(reason); drug.setRetiredBy(Context.getAuthenticatedUser()); service.updateDrug(drug); } return RestUtil.noContent(response); }  void initDrugController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New Drug") @ResponseBody Object createNewDrug(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing drug") @ResponseBody Object updateDrug(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Drug in the system") @ResponseBody() String getAllDrugs(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Drug for the uuid path") @ResponseBody() String getDrugByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET, params = "v") @WSDoc("Gets Full representation of Drug for the uuid path") @ResponseBody() String getDrugByUuidFull(@PathVariable("uuid") String uuid, @RequestParam("v") String rep,
	        HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Drug") @ResponseBody Object retireDrug(@PathVariable("uuid") String uuid,
	        @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request,
	        HttpServletResponse response);  }
@Test public void testRetireDrug() throws Exception { Drug drug = service.getDrugByUuid(getUuid()); Assert.assertFalse(drug.isRetired()); controller.retireDrug(getUuid(), "testing", request, response); Drug drug2 = service.getDrugByUuid(getUuid()); Assert.assertTrue(drug2.isRetired()); Assert.assertEquals("testing", drug2.getRetireReason()); }