@Test public void shouldGetByVendorId() throws Exception { List<MaintenanceLog> logs = new ArrayList<>(); when(service.getAllForVendor(1L)).thenReturn(logs); ResponseEntity<OpenLmisResponse> response = controller.getByVendorId(1L); assertThat(logs, 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)); }
MaintenanceLogController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); } }
MaintenanceLogController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(LOGS, service.getAllForVendor(id)); }  }
MaintenanceLogController 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(value = "save", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceLog log); @RequestMapping(value = "saveAndLogMaintenance", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceRequest maintenanceRequest, HttpServletRequest request); }
MaintenanceLogController 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(value = "save", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceLog log); @RequestMapping(value = "saveAndLogMaintenance", method = RequestMethod.POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody MaintenanceRequest maintenanceRequest, HttpServletRequest request); static final String LOG; static final String LOGS; static final String STATUS; }