use of com.thoughtworks.go.server.service.AccessTokenService in project gocd by gocd.
the class AccessTokenAuthenticationFilterTest method setUp.
@BeforeEach
void setUp() throws Exception {
clock = new TestingClock();
securityService = mock(SecurityService.class);
accessTokenService = mock(AccessTokenService.class);
authenticationProvider = mock(AccessTokenBasedPluginAuthenticationProvider.class);
securityAuthConfigService = mock(SecurityAuthConfigService.class);
response = new MockHttpServletResponse();
filterChain = mock(FilterChain.class);
filter = new AccessTokenAuthenticationFilter(securityService, accessTokenService, securityAuthConfigService, authenticationProvider);
accessToken = randomAccessTokenForUser(BOB);
when(accessTokenService.findByAccessToken(TOKEN)).thenReturn(accessToken);
authConfig = new SecurityAuthConfig(accessToken.getAuthConfigId(), PLUGIN_ID);
when(securityAuthConfigService.findProfile(accessToken.getAuthConfigId())).thenReturn(authConfig);
}
Aggregations