Skip to content

Commit a812ea8

Browse files
committed
fixed error in ResourceServerLiveTest due to previous Keycloak upgrade, and added test case for spring-security-oauth-jwt article code
1 parent 82bdafb commit a812ea8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

oauth-jwt/jwt-resource-server/src/test/java/com/baeldung/jwt/ResourceServerLiveTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void givenUserWithReadScope_whenGetProjectResource_thenSuccess() {
4646

4747
@Test
4848
public void givenUserWithOtherScope_whenGetProjectResource_thenForbidden() {
49-
String accessToken = obtainAccessToken("other");
49+
String accessToken = obtainAccessToken("email");
5050
System.out.println("ACCESS TOKEN: " + accessToken);
5151

5252
// Access resources using access token
@@ -68,7 +68,8 @@ public void givenUserWithReadScope_whenGetUserInformationResource_thenSuccess()
6868
.header(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)
6969
.get(userInfoResourceUrl);
7070
System.out.println(response.asString());
71-
assertThat(response.as(Map.class)).containsEntry("user_name", "john@test.com");
71+
assertThat(response.as(Map.class)).containsEntry("user_name", "john@test.com")
72+
.containsEntry("organization", "BAELDUNG");
7273
}
7374

7475
@Test

0 commit comments

Comments
 (0)