mirror of
https://github.com/spring-cloud/spring-cloud-netflix.git
synced 2026-09-17 15:49:00 +00:00
Merge remote-tracking branch 'origin/2.0.x'
This commit is contained in:
+4
-4
@@ -104,11 +104,11 @@ public class RetryableRibbonLoadBalancingHttpClient
|
||||
newRequest = newRequest.withNewUri(UriComponentsBuilder.newInstance()
|
||||
.host(service.getHost()).scheme(service.getUri().getScheme())
|
||||
.userInfo(newRequest.getURI().getUserInfo())
|
||||
.port(service.getPort()).path(newRequest.getURI().getPath())
|
||||
.port(service.getPort())
|
||||
.path(newRequest.getURI().getRawPath())
|
||||
.query(newRequest.getURI().getQuery())
|
||||
.fragment(newRequest.getURI().getFragment()).build().encode()
|
||||
.toUri());
|
||||
|
||||
.fragment(newRequest.getURI().getFragment()).build(true)
|
||||
.encode().toUri());
|
||||
if (ribbonLoadBalancerContext == null) {
|
||||
LOGGER.error(
|
||||
"RibbonLoadBalancerContext is null. Unable to update load balancer stats");
|
||||
|
||||
+10
-1
@@ -443,7 +443,7 @@ public class RibbonLoadBalancingHttpClientTests {
|
||||
String host = serviceName;
|
||||
int port = 80;
|
||||
HttpMethod method = HttpMethod.GET;
|
||||
URI uri = new URI("http://" + host + ":" + port);
|
||||
URI uri = new URI("http://" + host + ":" + port + "/a%2Bb");
|
||||
CloseableHttpClient delegate = mock(CloseableHttpClient.class);
|
||||
final CloseableHttpResponse response = mock(CloseableHttpResponse.class);
|
||||
StatusLine statusLine = mock(StatusLine.class);
|
||||
@@ -470,6 +470,15 @@ public class RibbonLoadBalancingHttpClientTests {
|
||||
verify(delegate, times(3)).execute(any(HttpUriRequest.class));
|
||||
verify(lb, times(2)).chooseServer(eq(serviceName));
|
||||
assertThat(myBackOffPolicy.getCount()).isEqualTo(2);
|
||||
verify(request, times(3)).withNewUri(argThat(new ArgumentMatcher<URI>() {
|
||||
@Override
|
||||
public boolean matches(URI argument) {
|
||||
if (argument.equals(uri)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user