@Test void testCheckRoleExistsUnknownRoleException() { @SuppressWarnings("unchecked") Query<Role> query = mock(Query.class, RETURNS_SELF); when(dataService.query(RoleMetadata.ROLE, Role.class)).thenReturn(query); assertThrows(UnknownRoleException.class, () -> userRoleTools.checkRoleExists("role")); }
public void checkRoleExists(String role) { if (getRole(role) == null) { throw new UnknownRoleException(role); } }
UserRoleTools { public void checkRoleExists(String role) { if (getRole(role) == null) { throw new UnknownRoleException(role); } } }
UserRoleTools { public void checkRoleExists(String role) { if (getRole(role) == null) { throw new UnknownRoleException(role); } } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); }
UserRoleTools { public void checkRoleExists(String role) { if (getRole(role) == null) { throw new UnknownRoleException(role); } } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); }
UserRoleTools { public void checkRoleExists(String role) { if (getRole(role) == null) { throw new UnknownRoleException(role); } } UserRoleTools(
      UserService userService,
      DataService dataService,
      UserPermissionEvaluator userPermissionEvaluator); void checkRoleExists(String role); void checkUserExists(String user); List<Sid> getSids(List<String> users, List<String> roles); static Optional<String> getUsername(Sid sid); static Optional<String> getRolename(Sid sid); static String getName(Sid sid); List<Sid> getRolesForSid(Sid sid); static final String ANONYMOUS; }