@Test public void shouldGetByVendorId() throws Exception { List<MaintenanceRequest> requests = new ArrayList<>(); when(service.getAllForVendor(2L)).thenReturn(requests); ResponseEntity<OpenLmisResponse> response = controller.getByVendorId(2L); assertThat(requests, is(response.getBody().getData().get("logs"))); }
@RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); }
MaintenanceRequestController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); } }
MaintenanceRequestController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); }  }
MaintenanceRequestController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); }  @RequestMapping(method = RequestMethod.GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = RequestMethod.GET, value = "id") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "for-facility") ResponseEntity<OpenLmisResponse> getByFacilityId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "for-vendor") ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "outstanding-for-vendor") ResponseEntity<OpenLmisResponse> getOutstandingByVendorId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "outstanding-for-user") ResponseEntity<OpenLmisResponse> getOutstandingByUserId( HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, value = "full-history") ResponseEntity<OpenLmisResponse> getFullHistoryId( @RequestParam("id") Long inventoryId); @RequestMapping(value = "save", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceRequest maintenanceRequest, HttpServletRequest request); }
MaintenanceRequestController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); }  @RequestMapping(method = RequestMethod.GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = RequestMethod.GET, value = "id") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "for-facility") ResponseEntity<OpenLmisResponse> getByFacilityId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "for-vendor") ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "outstanding-for-vendor") ResponseEntity<OpenLmisResponse> getOutstandingByVendorId( @RequestParam("id") Long id); @RequestMapping(method = RequestMethod.GET, value = "outstanding-for-user") ResponseEntity<OpenLmisResponse> getOutstandingByUserId( HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, value = "full-history") ResponseEntity<OpenLmisResponse> getFullHistoryId( @RequestParam("id") Long inventoryId); @RequestMapping(value = "save", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceRequest maintenanceRequest, HttpServletRequest request); static final String LOG; static final String LOGS; }