Skip to content

Commit

Permalink
fix: technical resolver change to switch to new authentication objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Apr 15, 2024
1 parent 8382134 commit ecf2059
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ private Collection<String> getRealmRoles(Jwt jwt) {
return Lists.newArrayList();
}


@Override
public boolean canResolve(HttpServletRequest request) {
return resolve(request).isPresent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.caritas.cob.videoservice.api.tenant;


import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -28,26 +27,21 @@
@ExtendWith(MockitoExtension.class)
class TechnicalUserTenantResolverTest {
public static final long TECHNICAL_CONTEXT = 0L;
@Mock
HttpServletRequest authenticatedRequest;
@Mock HttpServletRequest authenticatedRequest;

@Mock(answer = Answers.RETURNS_DEEP_STUBS)
KeycloakAuthenticationToken token;

@Mock(answer = Answers.RETURNS_DEEP_STUBS)
AccessToken accessToken;

@Mock
Access access;
@Mock Access access;

@Mock
SecurityContext mockSecurityContext;
@Mock SecurityContext mockSecurityContext;

@Mock
Authentication mockAuthentication;
@Mock Authentication mockAuthentication;

@InjectMocks
TechnicalUserTenantResolver technicalUserTenantResolver;
@InjectMocks TechnicalUserTenantResolver technicalUserTenantResolver;

@AfterEach
public void tearDown() {
Expand Down Expand Up @@ -94,4 +88,4 @@ private HashMap<String, Object> givenClaimMapContainingRole(String realmRole) {
claimMap.put("realm_access", realmAccess);
return claimMap;
}
}
}

0 comments on commit ecf2059

Please sign in to comment.