Skip to content

Commit

Permalink
change clientId to client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-spierefka committed Aug 7, 2024
1 parent 81e7d3b commit e1ba02d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

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

Expand Down

0 comments on commit e1ba02d

Please sign in to comment.