@Test public void shouldGetAll() throws Exception { List<ServiceType> types = new ArrayList<>(); when(service.getAll()).thenReturn(types); ResponseEntity<OpenLmisResponse> response = controller.getAll(); assertThat(types, is(response.getBody().getData().get("service_types"))); }
@RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response(SERVICE_TYPES, service.getAll()); }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response(SERVICE_TYPES, service.getAll()); } }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response(SERVICE_TYPES, service.getAll()); }  }
ServiceTypeController extends BaseController { @RequestMapping(method = GET, value = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response(SERVICE_TYPES, service.getAll()); }  @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 = "list") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS') or @permissionEvaluator.hasPermission(principal,'SERVICE_VENDOR_RIGHT')") public ResponseEntity<OpenLmisResponse> getAll(){ return OpenLmisResponse.response(SERVICE_TYPES, service.getAll()); }  @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; }