@Test public void shouldGetDataFromGetAll(){ List<DiscardingReason> reasons = asList(new DiscardingReason()); when(service.getAllReasons()).thenReturn(reasons); ResponseEntity<OpenLmisResponse> response = controller.getAll(); assertThat(reasons, is(response.getBody().getData().get("reasons"))); }
@RequestMapping("all") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response("reasons", service.getAllReasons()); }
DiscardingReasonsController extends BaseController { @RequestMapping("all") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response("reasons", service.getAllReasons()); } }
DiscardingReasonsController extends BaseController { @RequestMapping("all") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response("reasons", service.getAllReasons()); }  }
DiscardingReasonsController extends BaseController { @RequestMapping("all") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response("reasons", service.getAllReasons()); }  @RequestMapping("all") ResponseEntity<OpenLmisResponse> getAll(); }
DiscardingReasonsController extends BaseController { @RequestMapping("all") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response("reasons", service.getAllReasons()); }  @RequestMapping("all") ResponseEntity<OpenLmisResponse> getAll();  }