use of org.sonar.server.user.ThreadLocalUserSession in project sonarqube by SonarSource.
the class BaseContextFactoryTest method authenticate.
@Test
public void authenticate() throws Exception {
BaseIdentityProvider.Context context = underTest.newContext(request, response, identityProvider);
HttpSession session = mock(HttpSession.class);
when(request.getSession()).thenReturn(session);
context.authenticate(USER_IDENTITY);
verify(userIdentityAuthenticator).authenticate(USER_IDENTITY, identityProvider, AuthenticationEvent.Source.external(identityProvider));
verify(jwtHttpHandler).generateToken(any(UserDto.class), eq(request), eq(response));
verify(threadLocalUserSession).set(any(UserSession.class));
}
Aggregations