@Test public void shouldGetByVendorId() throws Exception { List<ServiceContract> list = new ArrayList<>(); when(service.getAllForVendor(5L)).thenReturn(list); ResponseEntity<OpenLmisResponse> response = controller.getByVendorId(5L); assertThat(list, is(response.getBody().getData().get("contracts"))); }
@RequestMapping(method = GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(CONTRACTS, service.getAllForVendor(id)); }
ServiceContractController extends BaseController { @RequestMapping(method = GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(CONTRACTS, service.getAllForVendor(id)); } }
ServiceContractController extends BaseController { @RequestMapping(method = GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(CONTRACTS, service.getAllForVendor(id)); }  }
ServiceContractController extends BaseController { @RequestMapping(method = GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(CONTRACTS, service.getAllForVendor(id)); }  @RequestMapping(method = GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(method = GET, value = "for-facility") ResponseEntity<OpenLmisResponse> getByFacilityId( @RequestParam("id") Long id); @RequestMapping(method = GET, value = "for-vendor") ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody ServiceContract contract); }
ServiceContractController extends BaseController { @RequestMapping(method = GET, value = "for-vendor") public ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id){ return OpenLmisResponse.response(CONTRACTS, service.getAllForVendor(id)); }  @RequestMapping(method = GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(method = GET, value = "for-facility") ResponseEntity<OpenLmisResponse> getByFacilityId( @RequestParam("id") Long id); @RequestMapping(method = GET, value = "for-vendor") ResponseEntity<OpenLmisResponse> getByVendorId( @RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody ServiceContract contract); static final String CONTRACT; static final String CONTRACTS; }