KeyCloakUserManager extends BaseKeyCloakManager implements UserManager,
                                                                        ContextualManager { protected CapabilityStatus getCapabilityStatus(final Capability capability) { if (capability != null) { switch (capability) { case CAN_SEARCH_USERS: case CAN_ADD_USER: case CAN_UPDATE_USER: case CAN_DELETE_USER: case CAN_READ_USER: case CAN_MANAGE_ATTRIBUTES: case CAN_ASSIGN_GROUPS: case CAN_ASSIGN_ROLES: case CAN_CHANGE_PASSWORD: return CapabilityStatus.ENABLED; } } return CapabilityStatus.UNSUPPORTED; } KeyCloakUserManager(); @Override void initialize(final UserSystemManager userSystemManager); @Override SearchResponse<User> search(SearchRequest request); @Override User get(String username); @Override List<User> getAll(); @Override User create(User entity); @Override User update(User entity); @Override void delete(String... identifiers); @Override UserManagerSettings getSettings(); @Override void assignGroups(String username,
                             Collection<String> groups); @Override void assignRoles(String username,
                            Collection<String> roles); @Override void changePassword(String username,
                               String newPassword); @Override void destroy();  }
@Test public void testCapabilities() { assertEquals(usersManager.getCapabilityStatus(Capability.CAN_SEARCH_USERS), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_READ_USER), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_UPDATE_USER), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_ADD_USER), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_DELETE_USER), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_MANAGE_ATTRIBUTES), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_ASSIGN_GROUPS), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_CHANGE_PASSWORD), CapabilityStatus.ENABLED); assertEquals(usersManager.getCapabilityStatus(Capability.CAN_ASSIGN_ROLES), CapabilityStatus.ENABLED); }