标签: roles
如何模拟和测试具有角色@PreAuthorize("hasAuthority('..')")的服务
@PreAuthorize("hasAuthority('..')")
when(sessionUtility.getLoggedInUser()).thenReturn(user.hasRole);
我可以访问user.hasRole,但不能访问hasAuthority。
user.hasRole
hasAuthority