@Test public void shouldGetAll() throws Exception { String allRaxaAlerts = controller.getAllRaxaAlerts(request, response); Assert.assertEquals(2, ((ArrayList) SimpleObject.parseJson(allRaxaAlerts).get("results")).size()); }
@RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() public String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRaxaAlertController(); List<RaxaAlert> allRaxaAlert = service.getAllRaxaAlerts(true); ArrayList results = new ArrayList(); for (RaxaAlert raxaAlert : allRaxaAlert) { results.add(getFieldsFromRaxaAlert(raxaAlert)); } return gson.toJson(new SimpleObject().add("results", results)); }
RaxaAlertController { @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() public String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRaxaAlertController(); List<RaxaAlert> allRaxaAlert = service.getAllRaxaAlerts(true); ArrayList results = new ArrayList(); for (RaxaAlert raxaAlert : allRaxaAlert) { results.add(getFieldsFromRaxaAlert(raxaAlert)); } return gson.toJson(new SimpleObject().add("results", results)); } }
RaxaAlertController { @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() public String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRaxaAlertController(); List<RaxaAlert> allRaxaAlert = service.getAllRaxaAlerts(true); ArrayList results = new ArrayList(); for (RaxaAlert raxaAlert : allRaxaAlert) { results.add(getFieldsFromRaxaAlert(raxaAlert)); } return gson.toJson(new SimpleObject().add("results", results)); }  }
RaxaAlertController { @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() public String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRaxaAlertController(); List<RaxaAlert> allRaxaAlert = service.getAllRaxaAlerts(true); ArrayList results = new ArrayList(); for (RaxaAlert raxaAlert : allRaxaAlert) { results.add(getFieldsFromRaxaAlert(raxaAlert)); } return gson.toJson(new SimpleObject().add("results", results)); }  void initRaxaAlertController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New RaxaAlert") @ResponseBody Object createNewRaxaAlert(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "providerRecipient") @WSDoc("Fetch all non-retired alerts according to providerRecipient") @ResponseBody() String searchByProviderRecipient(@RequestParam("providerRecipient") String providerRecipient,
	        HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "toLocation") @WSDoc("Fetch all non-retired alerts according to toLocation") @ResponseBody() String searchByToLocation(@RequestParam("toLocation") String toLocation, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing raxa alert") @ResponseBody Object updateRaxaAlert(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Raxa Alert for the given uuid") @ResponseBody() String getRaxaAlertByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); }
RaxaAlertController { @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() public String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response) throws ResponseException { initRaxaAlertController(); List<RaxaAlert> allRaxaAlert = service.getAllRaxaAlerts(true); ArrayList results = new ArrayList(); for (RaxaAlert raxaAlert : allRaxaAlert) { results.add(getFieldsFromRaxaAlert(raxaAlert)); } return gson.toJson(new SimpleObject().add("results", results)); }  void initRaxaAlertController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New RaxaAlert") @ResponseBody Object createNewRaxaAlert(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Raxa Alerts in the system") @ResponseBody() String getAllRaxaAlerts(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "providerRecipient") @WSDoc("Fetch all non-retired alerts according to providerRecipient") @ResponseBody() String searchByProviderRecipient(@RequestParam("providerRecipient") String providerRecipient,
	        HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "toLocation") @WSDoc("Fetch all non-retired alerts according to toLocation") @ResponseBody() String searchByToLocation(@RequestParam("toLocation") String toLocation, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing raxa alert") @ResponseBody Object updateRaxaAlert(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Raxa Alert for the given uuid") @ResponseBody() String getRaxaAlertByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request);  }