Search in sources :

Example 1 with SiteUrlProvider

use of com.thoughtworks.go.server.web.SiteUrlProvider in project gocd by gocd.

the class WebBasedAuthenticationFilterTest method setUp.

@Before
public void setUp() throws Exception {
    request = mock(HttpServletRequest.class);
    response = mock(HttpServletResponse.class);
    filterChain = mock(FilterChain.class);
    authorizationExtension = mock(AuthorizationExtension.class);
    goConfigService = mock(GoConfigService.class);
    siteUrlProvider = mock(SiteUrlProvider.class);
    securityConfig = new SecurityConfig();
    securityAuthConfig = new SecurityAuthConfig("github", "github.oauth", new ConfigurationProperty());
    securityConfig.securityAuthConfigs().add(securityAuthConfig);
    stub(goConfigService.security()).toReturn(securityConfig);
    filter = new WebBasedAuthenticationFilter(authorizationExtension, goConfigService, siteUrlProvider);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) SecurityAuthConfig(com.thoughtworks.go.config.SecurityAuthConfig) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) AuthorizationExtension(com.thoughtworks.go.plugin.access.authorization.AuthorizationExtension) FilterChain(javax.servlet.FilterChain) SiteUrlProvider(com.thoughtworks.go.server.web.SiteUrlProvider) HttpServletResponse(javax.servlet.http.HttpServletResponse) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Before(org.junit.Before)

Aggregations

SecurityAuthConfig (com.thoughtworks.go.config.SecurityAuthConfig)1 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)1 ConfigurationProperty (com.thoughtworks.go.domain.config.ConfigurationProperty)1 AuthorizationExtension (com.thoughtworks.go.plugin.access.authorization.AuthorizationExtension)1 GoConfigService (com.thoughtworks.go.server.service.GoConfigService)1 SiteUrlProvider (com.thoughtworks.go.server.web.SiteUrlProvider)1 FilterChain (javax.servlet.FilterChain)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Before (org.junit.Before)1