@Test public void testGetDrugInventoryByUuid() throws Exception { String uuid = "68547121-1b70-465c-99ee-c9dfd95e7d36"; String result = controller.getDrugInventoryByUuid(uuid, request); SimpleObject dI = SimpleObject.parseJson(result); Assert.assertNotNull(result); assertEquals(uuid, dI.get("uuid")); }
@RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() public String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException { initDrugInventoryController(); DrugInventory drugInventory = service.getDrugInventoryByUuid(uuid); SimpleObject obj = new SimpleObject(); obj.add("uuid", drugInventory.getUuid()); obj.add("drugId", drugInventory.getDrugId()); obj.add("quantity", drugInventory.getQuantity()); return gson.toJson(obj); }
DrugInventoryController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() public String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException { initDrugInventoryController(); DrugInventory drugInventory = service.getDrugInventoryByUuid(uuid); SimpleObject obj = new SimpleObject(); obj.add("uuid", drugInventory.getUuid()); obj.add("drugId", drugInventory.getDrugId()); obj.add("quantity", drugInventory.getQuantity()); return gson.toJson(obj); } }
DrugInventoryController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() public String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException { initDrugInventoryController(); DrugInventory drugInventory = service.getDrugInventoryByUuid(uuid); SimpleObject obj = new SimpleObject(); obj.add("uuid", drugInventory.getUuid()); obj.add("drugId", drugInventory.getDrugId()); obj.add("quantity", drugInventory.getQuantity()); return gson.toJson(obj); }  }
DrugInventoryController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() public String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException { initDrugInventoryController(); DrugInventory drugInventory = service.getDrugInventoryByUuid(uuid); SimpleObject obj = new SimpleObject(); obj.add("uuid", drugInventory.getUuid()); obj.add("drugId", drugInventory.getDrugId()); obj.add("quantity", drugInventory.getQuantity()); return gson.toJson(obj); }  void initDrugInventoryController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save DrugInventory") @ResponseBody Object saveDrugInventory(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); DrugInventory setPostFields(SimpleObject post, DrugInventory drugInventory); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing drug inventory") @ResponseBody Object updateDrugInventory(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Drug Inventories in the system") @ResponseBody() String getAllDrugInventories(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "location") @WSDoc("Fetch all non-retired inventories according to location") @ResponseBody() String searchByLocation(@RequestParam("location") String location, HttpServletRequest request); }
DrugInventoryController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() public String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException { initDrugInventoryController(); DrugInventory drugInventory = service.getDrugInventoryByUuid(uuid); SimpleObject obj = new SimpleObject(); obj.add("uuid", drugInventory.getUuid()); obj.add("drugId", drugInventory.getDrugId()); obj.add("quantity", drugInventory.getQuantity()); return gson.toJson(obj); }  void initDrugInventoryController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save DrugInventory") @ResponseBody Object saveDrugInventory(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); DrugInventory setPostFields(SimpleObject post, DrugInventory drugInventory); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets drug inventory for the uuid path") @ResponseBody() String getDrugInventoryByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing drug inventory") @ResponseBody Object updateDrugInventory(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Drug Inventories in the system") @ResponseBody() String getAllDrugInventories(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "location") @WSDoc("Fetch all non-retired inventories according to location") @ResponseBody() String searchByLocation(@RequestParam("location") String location, HttpServletRequest request);  }