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);
});
}
Aggregations