@Test public void shouldGetAllUsersAvailableForVendor() throws Exception { List<User> users = new ArrayList<>(); when(service.getAllUsersAvailableForVendor()).thenReturn(users); ResponseEntity<OpenLmisResponse> response = controller.getAllUsersAvailableForVendor(); assertThat(users, is(response.getBody().getData().get("users"))); }
@RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor() { return OpenLmisResponse.response(USERS, vendorUserService.getAllUsersAvailableForVendor()); }
VendorUserController extends BaseController { @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor() { return OpenLmisResponse.response(USERS, vendorUserService.getAllUsersAvailableForVendor()); } }
VendorUserController extends BaseController { @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor() { return OpenLmisResponse.response(USERS, vendorUserService.getAllUsersAvailableForVendor()); }  }
VendorUserController extends BaseController { @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor() { return OpenLmisResponse.response(USERS, vendorUserService.getAllUsersAvailableForVendor()); }  @RequestMapping(value = "getAllUsersForVendor/{vendorId}", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getAllUsersForVendor(@PathVariable(value = "vendorId") Long vendorId); @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor(); @RequestMapping(value="saveNewUserForVendor", method = RequestMethod.POST,headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> saveVendorUsers(@RequestBody VendorUser vendorUser, HttpServletRequest request); @RequestMapping(value="remove/{vendorId}/{userId}", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> remove(@PathVariable(value="vendorId") Long vendorId, @PathVariable(value="userId") Long userId); }
VendorUserController extends BaseController { @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") public ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor() { return OpenLmisResponse.response(USERS, vendorUserService.getAllUsersAvailableForVendor()); }  @RequestMapping(value = "getAllUsersForVendor/{vendorId}", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getAllUsersForVendor(@PathVariable(value = "vendorId") Long vendorId); @RequestMapping(value = "getAllUsersAvailableForVendor", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> getAllUsersAvailableForVendor(); @RequestMapping(value="saveNewUserForVendor", method = RequestMethod.POST,headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> saveVendorUsers(@RequestBody VendorUser vendorUser, HttpServletRequest request); @RequestMapping(value="remove/{vendorId}/{userId}", method = RequestMethod.GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_EQUIPMENT_SETTINGS')") ResponseEntity<OpenLmisResponse> remove(@PathVariable(value="vendorId") Long vendorId, @PathVariable(value="userId") Long userId); static final String VENDOR_USER; static final String USERS; }