@Test public void shouldGetById() throws Exception { ServiceType type = new ServiceType(); when(service.getById(2L)).thenReturn(type); ResponseEntity<OpenLmisResponse> response = controller.getById(2L); assertThat(type, is(response.getBody().getData().get("service_type"))); }
@RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id){ return OpenLmisResponse.response(SERVICE_TYPE, service.getById(id)); }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id){ return OpenLmisResponse.response(SERVICE_TYPE, service.getById(id)); } }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id){ return OpenLmisResponse.response(SERVICE_TYPE, service.getById(id)); }  }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id){ return OpenLmisResponse.response(SERVICE_TYPE, service.getById(id)); }  @RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> save(@RequestBody ServiceType type); }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id){ return OpenLmisResponse.response(SERVICE_TYPE, service.getById(id)); }  @RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(method = GET, value = "id") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getById( @RequestParam("id") Long id); @RequestMapping(value = "save", method = POST, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> save(@RequestBody ServiceType type); static final String SERVICE_TYPE; static final String SERVICE_TYPES; }