Skip to content
Snippets Groups Projects
Commit 776553f6 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6472 readd accidently removed code while merging

parent 681bcd1a
No related branches found
No related tags found
No related merge requests found
......@@ -72,8 +72,13 @@ class KeycloakRealmService {
Optional.of(realm)
.map(mapper::map)
.map(realmRepresentation -> addRealmName(realmRepresentation, realmName))
// TODO dieser Filter kann vermutlich gelöscht werden, die Prüfung auf
// realmExists passiert bereits vorher
.filter(realmRepresentation -> !keycloakGenericRemoteService.realmExists(realmName))
.ifPresent(remoteService::createRealm);
.ifPresent(realmRepresentation -> {
remoteService.createRealm(realmRepresentation);
addUserProfileAttributes(realmRepresentation);
});
}
void addOrUpdateRealmRoles(OzgCloudKeycloakRealmSpec spec, String realm) {
......
......@@ -95,13 +95,13 @@ class KeycloakRealmServiceTest {
verify(keycloakGenericRemoteService).getRealmRepresentation(REALM_NAME);
}
@Test
void shouldCallAddOrUpdateRealmRoles() {
service.createOrUpdateRealm(REALM, REALM_NAME);
verify(service).addOrUpdateRealmRoles(REALM, REALM_NAME);
}
}
@DisplayName("Update Realm")
......@@ -129,7 +129,6 @@ class KeycloakRealmServiceTest {
verify(mapper).update(realmRepresentation, REALM);
}
@Test
void createRealmShouldCallAddAttributes() {
service.updateRealm(realmRepresentation, REALM);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment