use of com.netflix.client.AbstractLoadBalancerAwareClient in project spring-cloud-netflix by spring-cloud.
the class RibbonClientConfigurationTests method clients.
private List<AbstractLoadBalancerAwareClient> clients() {
ArrayList<AbstractLoadBalancerAwareClient> clients = new ArrayList<>();
clients.add(new OverrideRestClient(this.config, this.inspector));
clients.add(new RibbonLoadBalancingHttpClient(this.config, this.inspector));
clients.add(new OkHttpLoadBalancingClient(this.config, this.inspector));
return clients;
}
use of com.netflix.client.AbstractLoadBalancerAwareClient in project spring-cloud-netflix by spring-cloud.
the class RibbonClientConfigurationTests method testNotDoubleEncodedWhenSecure.
@Test
public void testNotDoubleEncodedWhenSecure() throws Exception {
Server server = new Server("foo", 7777);
when(this.inspector.isSecure(server)).thenReturn(true);
for (AbstractLoadBalancerAwareClient client : clients()) {
URI uri = client.reconstructURIWithServer(server, new URI("http://foo/%20bar"));
assertThat(getReason(client), uri, is(new URI("https://foo:7777/%20bar")));
}
}
use of com.netflix.client.AbstractLoadBalancerAwareClient in project spring-cloud-netflix by spring-cloud.
the class RibbonClientConfigurationTests method testInSecureUriFromClientConfig.
@Test
public void testInSecureUriFromClientConfig() throws Exception {
Server server = new Server("foo", 7777);
when(this.inspector.isSecure(server)).thenReturn(false);
for (AbstractLoadBalancerAwareClient client : clients()) {
URI uri = client.reconstructURIWithServer(server, new URI("http://foo/"));
assertThat(getReason(client), uri, is(new URI("http://foo:7777/")));
}
}
use of com.netflix.client.AbstractLoadBalancerAwareClient in project spring-cloud-netflix by spring-cloud.
the class RibbonClientConfigurationTests method testSecureUriFromClientConfig.
@Test
public void testSecureUriFromClientConfig() throws Exception {
Server server = new Server("foo", 7777);
when(this.inspector.isSecure(server)).thenReturn(true);
for (AbstractLoadBalancerAwareClient client : clients()) {
URI uri = client.reconstructURIWithServer(server, new URI("http://foo/"));
assertThat(getReason(client), uri, is(new URI("https://foo:7777/")));
}
}
use of com.netflix.client.AbstractLoadBalancerAwareClient in project spring-cloud-netflix by spring-cloud.
the class RibbonClientConfigurationTests method testPlusInQueryStringGetsRewrittenWhenServerIsSecure.
@Test
public void testPlusInQueryStringGetsRewrittenWhenServerIsSecure() throws Exception {
Server server = new Server("foo", 7777);
when(this.inspector.isSecure(server)).thenReturn(true);
for (AbstractLoadBalancerAwareClient client : clients()) {
URI uri = client.reconstructURIWithServer(server, new URI("http://foo/%20bar?hello=1+2"));
assertThat(uri, is(new URI("https://foo:7777/%20bar?hello=1%202")));
}
}
Aggregations