Skip to content

Commit

Permalink
feat: update keycloak to version 11.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mebo4b committed Nov 5, 2020
1 parent 52bc0ed commit f73aefc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-security-adapter</artifactId>
<version>4.4.0.Final</version>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-boot-starter</artifactId>
<version>4.4.0.Final</version>
<version>11.0.2</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
Expand All @@ -96,7 +96,7 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>4.4.0.Final</version>
<version>11.0.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.caritas.cob.liveservice.websocket.service;

import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.keycloak.adapters.rotation.AdapterRSATokenVerifier.verifyToken;
import static org.keycloak.adapters.rotation.AdapterTokenVerifier.verifyToken;

import lombok.NonNull;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.rotation.AdapterRSATokenVerifier;
import org.keycloak.adapters.rotation.AdapterTokenVerifier;
import org.keycloak.adapters.springboot.KeycloakSpringBootProperties;
import org.keycloak.common.VerificationException;
import org.keycloak.representations.AccessToken;
Expand All @@ -19,7 +19,7 @@
import org.powermock.modules.junit4.PowerMockRunner;

@RunWith(PowerMockRunner.class)
@PrepareForTest({AdapterRSATokenVerifier.class, KeycloakDeploymentBuilder.class})
@PrepareForTest({AdapterTokenVerifier.class, KeycloakDeploymentBuilder.class})
public class KeycloakTokenObserverTest {

@InjectMocks
Expand All @@ -44,10 +44,10 @@ public void observeUserId_Should_throwVerificationException_When_tokenIsEmpty()
public void observeUserId_Should_returnUserId_When_tokenIsValid()
throws VerificationException {
mockStatic(KeycloakDeploymentBuilder.class);
mockStatic(AdapterRSATokenVerifier.class);
mockStatic(AdapterTokenVerifier.class);
AccessToken accessToken = new AccessToken();
accessToken.setOtherClaims("userId", "validId");
when(AdapterRSATokenVerifier.verifyToken(any(), any())).thenReturn(accessToken);
when(AdapterTokenVerifier.verifyToken(any(), any())).thenReturn(accessToken);

String userId = this.keycloakTokenObserver.observeUserId("valid token");
assertThat(userId, is("validId"));
Expand Down

0 comments on commit f73aefc

Please sign in to comment.