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 <[email protected]>
  • Loading branch information
2 people authored and sschnabe committed Dec 3, 2024
1 parent bd58bdc commit d660843
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .github/auto-merge.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/dependabot-auto-merge.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->

Expand Down
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;

Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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 d660843

Please sign in to comment.