From e1ba02db1425fe4223331bbe0e12c595a2f0d7d2 Mon Sep 17 00:00:00 2001 From: Julian Spierefka Date: Wed, 7 Aug 2024 13:28:03 +0200 Subject: [PATCH] change clientId to client_id --- .../telekom/horizon/starlight/service/TokenServiceTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/telekom/horizon/starlight/service/TokenServiceTest.java b/src/test/java/de/telekom/horizon/starlight/service/TokenServiceTest.java index f52689e..9755e5a 100644 --- a/src/test/java/de/telekom/horizon/starlight/service/TokenServiceTest.java +++ b/src/test/java/de/telekom/horizon/starlight/service/TokenServiceTest.java @@ -48,14 +48,14 @@ void initTokenService(TestInfo testInfo) { @Test @DisplayName("Publisher ID can be retrieved from clientId claim of token") void publisherIdCanBeRetrievedFromClientIdTokenClaim() { - var jwtSpy = Mockito.spy(createNewJwtForPublisherId(Map.of("clientId", DEFAULT_PUBLISHER_ID, "azp", DEFAULT_PUBLISHER_ID, JwtClaimNames.ISS, DEFAULT_ISSUER_URL))); + var jwtSpy = Mockito.spy(createNewJwtForPublisherId(Map.of("client_id", DEFAULT_PUBLISHER_ID, "azp", DEFAULT_PUBLISHER_ID, JwtClaimNames.ISS, DEFAULT_ISSUER_URL))); var principal = new JwtAuthenticationToken(jwtSpy); when(httpServletRequest.getUserPrincipal()).thenReturn(principal); assertThat(tokenService.getPublisherId(), is(equalTo(DEFAULT_PUBLISHER_ID))); assertThat(tokenService.getRealm(), is(equalTo("av"))); - verify(jwtSpy, times(1)).getClaimAsString("clientId"); + verify(jwtSpy, times(1)).getClaimAsString("client_id"); verify(jwtSpy, times(0)).getClaimAsString("azp"); } @@ -68,7 +68,7 @@ void publisherIdCanBeRetrievedFromAzpTokenClaim() { when(httpServletRequest.getUserPrincipal()).thenReturn(principal); assertThat(tokenService.getPublisherId(), is(equalTo(DEFAULT_PUBLISHER_ID))); - verify(jwtSpy, times(1)).getClaimAsString("clientId"); + verify(jwtSpy, times(1)).getClaimAsString("client_id"); verify(jwtSpy, times(1)).getClaimAsString("azp"); }