Skip to content

Commit

Permalink
fix: CARITAS-243 - fix unit tests before code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro13Silva13 committed Aug 19, 2024
1 parent 90fe7a3 commit f560afd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void resolve_should_ResolveTechnicalTenantId_ForTechnicalUserRole() {
void resolve_should_NotResolveTenantId_When_NonTechnicalUserRole() {
// given
givenUserIsAuthenticated();
when(mockAuthentication.getPrincipal()).thenReturn(buildJwtWithRealmRole("another-role"));
when(mockAuthentication.getPrincipal()).thenReturn((Object) buildJwtWithRealmRole("another-role"));
var resolved = technicalUserTenantResolver.resolve(authenticatedRequest);
// then
assertThat(resolved).isEmpty();
Expand All @@ -78,7 +78,7 @@ private Jwt buildJwtWithRealmRole(String realmRole) {
headers.put("alg", "HS256"); // Signature algorithm
headers.put("typ", "JWT"); // Token type
return new Jwt(
"token", Instant.now(), Instant.now(), headers, givenClaimMapContainingRole(realmRole));
"token", Instant.now(), Instant.now().plusSeconds(1), headers, givenClaimMapContainingRole(realmRole));
}

private HashMap<String, Object> givenClaimMapContainingRole(String realmRole) {
Expand Down

0 comments on commit f560afd

Please sign in to comment.