@Test public void shouldGetById() throws Exception { Vendor vendor = new Vendor(); when(service.getById(2L)).thenReturn(vendor); ResponseEntity<OpenLmisResponse> response = controller.getById(2L); assertThat(vendor, is(response.getBody().getData().get("vendor"))); }
@RequestMapping(method = GET, value = "id") public ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id) { return OpenLmisResponse.response(VENDOR, service.getById(id)); }
VendorController extends BaseController { @RequestMapping(method = GET, value = "id") public ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id) { return OpenLmisResponse.response(VENDOR, service.getById(id)); } }
VendorController extends BaseController { @RequestMapping(method = GET, value = "id") public ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id) { return OpenLmisResponse.response(VENDOR, service.getById(id)); }  }
VendorController extends BaseController { @RequestMapping(method = GET, value = "id") public ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id) { return OpenLmisResponse.response(VENDOR, service.getById(id)); }  @RequestMapping(method = GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody Vendor vendor); @RequestMapping(value = "delete/{id}", method = GET, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> remove(@PathVariable(value = "id") Long vendorId); }
VendorController extends BaseController { @RequestMapping(method = GET, value = "id") public ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id) { return OpenLmisResponse.response(VENDOR, service.getById(id)); }  @RequestMapping(method = GET, value = "list") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") ResponseEntity<OpenLmisResponse> getById(@RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> save(@RequestBody Vendor vendor); @RequestMapping(value = "delete/{id}", method = GET, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> remove(@PathVariable(value = "id") Long vendorId); static final String VENDOR; }