use of com.thoughtworks.go.server.newsecurity.providers.AnonymousAuthenticationProvider in project gocd by gocd.
the class AbstractReAuthenticationFilterTest method setUp.
@BeforeEach
void setUp() {
response = new MockHttpServletResponse();
filterChain = mock(FilterChain.class);
securityService = mock(SecurityService.class);
systemEnvironment = mock(SystemEnvironment.class);
when(systemEnvironment.isReAuthenticationEnabled()).thenReturn(true);
passwordBasedPluginAuthenticationProvider = mock(PasswordBasedPluginAuthenticationProvider.class);
webBasedPluginAuthenticationProvider = mock(WebBasedPluginAuthenticationProvider.class);
anonymousAuthenticationProvider = mock(AnonymousAuthenticationProvider.class);
clock = new TestingClock();
filter = spy(new AbstractReAuthenticationFilter(securityService, systemEnvironment, clock, passwordBasedPluginAuthenticationProvider, webBasedPluginAuthenticationProvider, anonymousAuthenticationProvider) {
@Override
protected void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, String errorMessage) throws IOException {
}
});
}
use of com.thoughtworks.go.server.newsecurity.providers.AnonymousAuthenticationProvider in project gocd by gocd.
the class AssumeAnonymousUserFilterTest method setUp.
@BeforeEach
void setUp() {
clock = new TestingClock();
securityService = mock(SecurityService.class);
anonymousAuthenticationProvider = new AnonymousAuthenticationProvider(clock, new AuthorityGranter(securityService));
filterChain = mock(FilterChain.class);
response = new MockHttpServletResponse();
request = new MockHttpServletRequest();
}
use of com.thoughtworks.go.server.newsecurity.providers.AnonymousAuthenticationProvider in project gocd by gocd.
the class AuthenticationFilterChainTest method setUp.
@BeforeEach
void setUp() throws IOException {
response = new MockHttpServletResponse();
filterChain = mock(FilterChain.class);
securityService = mock(SecurityService.class);
clock = new TestingClock();
systemEnvironment = new SystemEnvironment();
final AnonymousAuthenticationProvider anonymousAuthenticationProvider = new AnonymousAuthenticationProvider(clock, new AuthorityGranter(securityService));
assumeAnonymousUserFilter = new AssumeAnonymousUserFilter(securityService, anonymousAuthenticationProvider);
}
Aggregations