use of com.thoughtworks.go.domain.ServerSiteUrlConfig in project gocd by gocd.
the class SecurityServiceIntegrationTest method shouldReturnSecureSiteUrlAsCasServiceBaseUrlIfBothSiteUrlAndSecureSiteUrlAreDefined.
@Test
public void shouldReturnSecureSiteUrlAsCasServiceBaseUrlIfBothSiteUrlAndSecureSiteUrlAreDefined() throws Exception {
configHelper.setBaseUrls(new ServerSiteUrlConfig("http://example.com"), new ServerSiteUrlConfig("https://example.com"));
assertThat(securityService.casServiceBaseUrl(), is("https://example.com"));
}
use of com.thoughtworks.go.domain.ServerSiteUrlConfig in project gocd by gocd.
the class ServerConfigServiceIntegrationTest method shouldUseTheSecureSiteUrlInspiteOfCallerNotForcingSsl_whenAlreadyUsingHTTPS.
@Test
public void shouldUseTheSecureSiteUrlInspiteOfCallerNotForcingSsl_whenAlreadyUsingHTTPS() throws URISyntaxException {
configHelper.setBaseUrls(new ServerSiteUrlConfig("http://foo.com:80"), new ServerSiteUrlConfig("https://bar.com:443"));
assertThat(serverConfigService.siteUrlFor("https://test.host:1000/foo/bar", false), is("https://bar.com:443/foo/bar"));
assertThat(serverConfigService.siteUrlFor("http://test.host/foo/bar", false), is("http://foo.com:80/foo/bar"));
}
use of com.thoughtworks.go.domain.ServerSiteUrlConfig in project gocd by gocd.
the class ServerConfigServiceIntegrationTest method shouldUpdateWithEmptySecureSiteUrlAndSiteUrl.
@Test
public void shouldUpdateWithEmptySecureSiteUrlAndSiteUrl() throws InvalidCipherTextException {
HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
MailHost mailHost = new MailHost("boo", 1, "username", "password", new GoCipher().encrypt("password"), true, true, "from@from.com", "admin@admin.com", new GoCipher());
serverConfigService.updateServerConfig(mailHost, "newArtifactsDir", null, null, "42", true, "", "", "default", result, goConfigDao.md5OfConfigFile());
assertThat(goConfigService.serverConfig().getSiteUrl(), is(new ServerSiteUrlConfig()));
assertThat(goConfigService.serverConfig().getSecureSiteUrl(), is(new ServerSiteUrlConfig()));
}
Aggregations