@Test public void shouldGetOneDisease() throws Exception { VaccineDisease disease = new VaccineDisease(); disease.setName("Polio"); when(service.getById(1L)).thenReturn(disease); ResponseEntity<OpenLmisResponse> response = controller.get(1L); assertThat(disease, is(response.getBody().getData().get("disease"))); }
@RequestMapping(value="get/{id}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long id) { return OpenLmisResponse.response(DISEASE, service.getById(id)); }
DiseaseController extends BaseController { @RequestMapping(value="get/{id}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long id) { return OpenLmisResponse.response(DISEASE, service.getById(id)); } }
DiseaseController extends BaseController { @RequestMapping(value="get/{id}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long id) { return OpenLmisResponse.response(DISEASE, service.getById(id)); }  }
DiseaseController extends BaseController { @RequestMapping(value="get/{id}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long id) { return OpenLmisResponse.response(DISEASE, service.getById(id)); }  @RequestMapping(value="get/{id}") ResponseEntity<OpenLmisResponse> get(@PathVariable Long id); @RequestMapping(value="all") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(value="save", headers = ACCEPT_JSON, method = RequestMethod.POST) @Transactional @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_VACCINE_DISEASE_LIST')") ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineDisease disease); }
DiseaseController extends BaseController { @RequestMapping(value="get/{id}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long id) { return OpenLmisResponse.response(DISEASE, service.getById(id)); }  @RequestMapping(value="get/{id}") ResponseEntity<OpenLmisResponse> get(@PathVariable Long id); @RequestMapping(value="all") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(value="save", headers = ACCEPT_JSON, method = RequestMethod.POST) @Transactional @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_VACCINE_DISEASE_LIST')") ResponseEntity<OpenLmisResponse> save(@RequestBody VaccineDisease disease); static final String DISEASE; }