@Test public void shouldGetAll() throws Exception { List<Vendor> vendors = new ArrayList<>(); when(service.getAll()).thenReturn(vendors); ResponseEntity<OpenLmisResponse> response = controller.getAll(); assertThat(vendors, is(response.getBody().getData().get("vendors"))); }
@RequestMapping(method = GET, value = "list") public ResponseEntity<OpenLmisResponse> getAll() { return OpenLmisResponse.response("vendors", service.getAll()); }
VendorController extends BaseController { @RequestMapping(method = GET, value = "list") public ResponseEntity<OpenLmisResponse> getAll() { return OpenLmisResponse.response("vendors", service.getAll()); } }
VendorController extends BaseController { @RequestMapping(method = GET, value = "list") public ResponseEntity<OpenLmisResponse> getAll() { return OpenLmisResponse.response("vendors", service.getAll()); }  }
VendorController extends BaseController { @RequestMapping(method = GET, value = "list") public ResponseEntity<OpenLmisResponse> getAll() { return OpenLmisResponse.response("vendors", service.getAll()); }  @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 = "list") public ResponseEntity<OpenLmisResponse> getAll() { return OpenLmisResponse.response("vendors", service.getAll()); }  @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; }