Skip to content

Commit

Permalink
Head to KeyCloak 26.0.5 (#178)
Browse files Browse the repository at this point in the history
* Head to KeyCloak 26.0.5

* Fix tests to fit new features

---------

Co-authored-by: Fabian Schlegel <fabian@fabin-thinkpad.localnet>
  • Loading branch information
fabian-schlegel and Fabian Schlegel authored Dec 3, 2024
1 parent bd58bdc commit 6912f7e
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@
<version.io.kokuwa.keycloak.metrics>1.0.0</version.io.kokuwa.keycloak.metrics>
<version.io.kokuwa.maven.k3s>1.3.0</version.io.kokuwa.maven.k3s>
<version.io.kubernetes.client>19.0.0</version.io.kubernetes.client>
<version.org.keycloak>25.0.6</version.org.keycloak>
<version.org.keycloak>26.0.5</version.org.keycloak>

<!-- images -->

10 changes: 4 additions & 6 deletions src/test/java/io/kokuwa/keycloak/FailoverIT.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.kokuwa.keycloak;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.stream.IntStream;

@@ -13,7 +12,6 @@
import io.kokuwa.keycloak.k8s.KubernetesExtension;
import io.kokuwa.keycloak.keycloak.KeycloakExtension;
import io.kokuwa.keycloak.keycloak.OpenIDConnect;
import jakarta.ws.rs.NotAuthorizedException;

@DisplayName("failover")
@ExtendWith(KubernetesExtension.class)
@@ -40,9 +38,9 @@ void rollingRestart(Kubernetes kubernetes, OpenIDConnect oidc) {
"session should be available after restart"));
}

@DisplayName("session should be lost after scaling keycloak to 0")
@DisplayName("session should remain after scaling keycloak to 0")
@Test
void sessionLost(Kubernetes kubernetes, OpenIDConnect oidc) {
void sessionRemains(Kubernetes kubernetes, OpenIDConnect oidc) {

// get token and validate on userinfo endpoint

@@ -54,8 +52,8 @@ void sessionLost(Kubernetes kubernetes, OpenIDConnect oidc) {
kubernetes.scaleKeycloak(0);
kubernetes.scaleKeycloak(Kubernetes.KEYCLOAK_REPLICAS);

// try to validate old token, should fail because session was lost
// try to validate old token, should be fine because session should be stored since KeyCloak >= 26

assertThrows(NotAuthorizedException.class, () -> oidc.userinfo("test", token), "session should be lost");
assertDoesNotThrow(() -> oidc.userinfo("test", token), "session should still be valid");
}
}

0 comments on commit 6912f7e

Please sign in to comment.