Search in sources :

Example 1 with UserMapStorage

use of org.keycloak.testsuite.federation.UserMapStorage in project keycloak by keycloak.

the class AbstractUserStorageDirtyDeletionTest method remove20UsersFromStorageProvider.

public static void remove20UsersFromStorageProvider(KeycloakSession session) {
    assertThat(REMOVED_USERS_COUNT, Matchers.lessThan(NUM_USERS));
    final RealmModel realm = session.realms().getRealm(TEST_REALM_NAME);
    UserStorageProvidersTestUtils.getEnabledStorageProviders(session, realm, UserMapStorage.class).forEachOrdered((UserMapStorage userMapStorage) -> {
        Set<String> users = new HashSet<>(userMapStorage.getUsernames());
        users.stream().sorted().limit(REMOVED_USERS_COUNT).forEach(userMapStorage::removeUserByName);
    });
}
Also used : RealmModel(org.keycloak.models.RealmModel) UserMapStorage(org.keycloak.testsuite.federation.UserMapStorage) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 RealmModel (org.keycloak.models.RealmModel)1 UserMapStorage (org.keycloak.testsuite.federation.UserMapStorage)1