@Test public void shouldReturnRequisitionListGivenStartAndEnd() throws Exception { Date startTime = new Date(); Date endTime = new Date(); List<RequisitionDTO> requisitionDTOs = new ArrayList<RequisitionDTO>(); RequisitionDTO requisitionDTO = new RequisitionDTO(); requisitionDTO.setId(2L); requisitionDTOs.add(requisitionDTO); when(requisitionReportsMapper.getRequisitionList(startTime, endTime)) .thenReturn(requisitionDTOs); ResponseEntity<OpenLmisResponse> response = controller.requisitionReport(startTime, endTime); assertThat(response.getStatusCode(), is(HttpStatus.OK)); assertThat((List<RequisitionDTO>) response.getBody().getData().get("rnr_list"), is (requisitionDTOs)); }
@RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) public ResponseEntity<OpenLmisResponse> requisitionReport( @RequestParam (value = "startTime", required = true) Date startTime, @RequestParam(value = "endTime", required = true) Date endTime) { return OpenLmisResponse.response("rnr_list", requisitionReportsMapper .getRequisitionList(startTime, endTime)); }
SimpleTableController extends BaseController { @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) public ResponseEntity<OpenLmisResponse> requisitionReport( @RequestParam (value = "startTime", required = true) Date startTime, @RequestParam(value = "endTime", required = true) Date endTime) { return OpenLmisResponse.response("rnr_list", requisitionReportsMapper .getRequisitionList(startTime, endTime)); } }
SimpleTableController extends BaseController { @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) public ResponseEntity<OpenLmisResponse> requisitionReport( @RequestParam (value = "startTime", required = true) Date startTime, @RequestParam(value = "endTime", required = true) Date endTime) { return OpenLmisResponse.response("rnr_list", requisitionReportsMapper .getRequisitionList(startTime, endTime)); }  }
SimpleTableController extends BaseController { @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) public ResponseEntity<OpenLmisResponse> requisitionReport( @RequestParam (value = "startTime", required = true) Date startTime, @RequestParam(value = "endTime", required = true) Date endTime) { return OpenLmisResponse.response("rnr_list", requisitionReportsMapper .getRequisitionList(startTime, endTime)); }  @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> requisitionReport(
					@RequestParam (value = "startTime", required = true) Date startTime,
					@RequestParam(value = "endTime", required = true) Date endTime); @RequestMapping(value = "/single-product-report", method = GET, headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> singleProductReport(
			@RequestParam(value = "geographicZoneId", required = false) Long geographicZoneId,
			@RequestParam(value = "productId") final Long productId,
			@RequestParam(value = "endTime", required = false) final Date endTime); @RequestMapping(value = "/all-products-report",method = GET,headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> allProductsReport(
			@RequestParam(value = "facilityId",required = true) Long facilityId,
			@RequestParam(value = "endTime", required = false) final Date endTime); @InitBinder void initBinder(WebDataBinder binder); }
SimpleTableController extends BaseController { @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) public ResponseEntity<OpenLmisResponse> requisitionReport( @RequestParam (value = "startTime", required = true) Date startTime, @RequestParam(value = "endTime", required = true) Date endTime) { return OpenLmisResponse.response("rnr_list", requisitionReportsMapper .getRequisitionList(startTime, endTime)); }  @RequestMapping(value = "/requisition-report", method = GET, headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> requisitionReport(
					@RequestParam (value = "startTime", required = true) Date startTime,
					@RequestParam(value = "endTime", required = true) Date endTime); @RequestMapping(value = "/single-product-report", method = GET, headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> singleProductReport(
			@RequestParam(value = "geographicZoneId", required = false) Long geographicZoneId,
			@RequestParam(value = "productId") final Long productId,
			@RequestParam(value = "endTime", required = false) final Date endTime); @RequestMapping(value = "/all-products-report",method = GET,headers = BaseController.ACCEPT_JSON) ResponseEntity<OpenLmisResponse> allProductsReport(
			@RequestParam(value = "facilityId",required = true) Long facilityId,
			@RequestParam(value = "endTime", required = false) final Date endTime); @InitBinder void initBinder(WebDataBinder binder);  }