use of com.yahoo.vespa.model.container.search.searchchain.HttpProvider in project vespa by vespa-engine.
the class DomProviderBuilderTest method testCertificateConfig_noProxy.
@Test
public void testCertificateConfig_noProxy() {
provider = new DomProviderBuilder(new HashMap<String, ComponentsBuilder.ComponentType>()).doBuild(root, noProxy);
ChainedComponent providerSearcher = provider.getInnerComponents().iterator().next();
assertThat(providerSearcher, instanceOf(HttpProviderSearcher.class));
ProviderConfig.Builder providerBuilder = new ProviderConfig.Builder();
((HttpProvider) provider).getConfig(providerBuilder);
ProviderConfig providerConfig = new ProviderConfig(providerBuilder);
assertThat(providerConfig.yca().applicationId(), is("my-app"));
assertThat(providerConfig.yca().useProxy(), is(false));
}
use of com.yahoo.vespa.model.container.search.searchchain.HttpProvider in project vespa by vespa-engine.
the class DomProviderBuilder method buildHttpProvider.
private Provider buildHttpProvider(ChainSpecification specWithoutInnerSearchers, ProviderReader providerReader, FederationOptions federationOptions) {
ensureEmpty(specWithoutInnerSearchers.componentId, providerReader.clusterName);
Provider httpProvider = buildEmptyHttpProvider(specWithoutInnerSearchers, providerReader, federationOptions);
httpProvider.addInnerComponent(new HttpProviderSearcher(new ChainedComponentModel(HttpProviderSpec.toBundleInstantiationSpecification(HttpProviderSpec.Type.valueOf(providerReader.type)), Dependencies.emptyDependencies())));
return httpProvider;
}
use of com.yahoo.vespa.model.container.search.searchchain.HttpProvider in project vespa by vespa-engine.
the class DomProviderBuilderTest method testCertificateConfig_proprietaryProxy.
@Test
public void testCertificateConfig_proprietaryProxy() {
provider = new DomProviderBuilder(new HashMap<String, ComponentsBuilder.ComponentType>()).doBuild(root, proprietaryProxy);
ProviderConfig.Builder providerBuilder = new ProviderConfig.Builder();
((HttpProvider) provider).getConfig(providerBuilder);
ProviderConfig providerConfig = new ProviderConfig(providerBuilder);
assertThat(providerConfig.yca().applicationId(), is("my-app"));
assertThat(providerConfig.yca().useProxy(), is(true));
assertThat(providerConfig.yca().host(), is("my-host"));
assertThat(providerConfig.yca().port(), is(80));
}
use of com.yahoo.vespa.model.container.search.searchchain.HttpProvider in project vespa by vespa-engine.
the class DomProviderBuilderTest method testCertificatewConfig_defaultProxy.
@Test
public void testCertificatewConfig_defaultProxy() {
provider = new DomProviderBuilder(new HashMap<String, ComponentsBuilder.ComponentType>()).doBuild(root, defaultProxy);
ProviderConfig.Builder providerBuilder = new ProviderConfig.Builder();
((HttpProvider) provider).getConfig(providerBuilder);
ProviderConfig providerConfig = new ProviderConfig(providerBuilder);
assertThat(providerConfig.yca().applicationId(), is("my-app"));
assertThat(providerConfig.yca().useProxy(), is(true));
// default from def-file
assertThat(providerConfig.yca().host(), is("yca.host must be set explicitly"));
// default from def-file
assertThat(providerConfig.yca().port(), is(3128));
}
Aggregations