Update SNAPSHOT to 2.2.9.RELEASE
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-openfeign</artifactId>
|
||||
<version>2.2.9.BUILD-SNAPSHOT</version>
|
||||
<version>2.2.9.RELEASE</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-openfeign-docs</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-cloud-openfeign</artifactId>
|
||||
<version>2.2.9.BUILD-SNAPSHOT</version>
|
||||
<version>2.2.9.RELEASE</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud OpenFeign</name>
|
||||
<description>Spring Cloud OpenFeign</description>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>2.3.4.RELEASE</version>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<scm>
|
||||
@@ -26,8 +26,8 @@
|
||||
<properties>
|
||||
<main.basedir>${basedir}</main.basedir>
|
||||
<jackson.version>2.11.3</jackson.version>
|
||||
<spring-cloud-commons.version>2.2.9.BUILD-SNAPSHOT</spring-cloud-commons.version>
|
||||
<spring-cloud-netflix.version>2.2.9.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
<spring-cloud-commons.version>2.2.9.RELEASE</spring-cloud-commons.version>
|
||||
<spring-cloud-netflix.version>2.2.9.RELEASE</spring-cloud-netflix.version>
|
||||
|
||||
<!-- Plugin versions -->
|
||||
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-openfeign</artifactId>
|
||||
<version>2.2.9.BUILD-SNAPSHOT</version>
|
||||
<version>2.2.9.RELEASE</version>
|
||||
<relativePath>..</relativePath> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<artifactId>spring-cloud-openfeign-core</artifactId>
|
||||
|
||||
+2
-1
@@ -375,7 +375,8 @@ public class FeignClientFactoryBean implements FactoryBean<Object>, Initializing
|
||||
if (!StringUtils.hasText(url)) {
|
||||
|
||||
if (LOG.isInfoEnabled()) {
|
||||
LOG.info("For '" + name + "' URL not provided. Will try picking an instance via load-balancing.");
|
||||
LOG.info("For '" + name
|
||||
+ "' URL not provided. Will try picking an instance via load-balancing.");
|
||||
}
|
||||
if (!name.startsWith("http")) {
|
||||
url = "http://" + name;
|
||||
|
||||
+4
-2
@@ -28,11 +28,13 @@ import org.springframework.cloud.client.loadbalancer.RetryableStatusCodeExceptio
|
||||
*
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class LoadBalancerResponseStatusCodeException extends RetryableStatusCodeException {
|
||||
public class LoadBalancerResponseStatusCodeException
|
||||
extends RetryableStatusCodeException {
|
||||
|
||||
private final Response response;
|
||||
|
||||
public LoadBalancerResponseStatusCodeException(String serviceId, Response response, byte[] body, URI uri) {
|
||||
public LoadBalancerResponseStatusCodeException(String serviceId, Response response,
|
||||
byte[] body, URI uri) {
|
||||
super(serviceId, response.status(), response, uri);
|
||||
this.response = Response.builder()
|
||||
.body(new ByteArrayInputStream(body), body.length)
|
||||
|
||||
+10
-8
@@ -119,8 +119,10 @@ class RetryableFeignBlockingLoadBalancerClientTests {
|
||||
|
||||
private Response testResponse(int status, String body) {
|
||||
// ByteArrayInputStream ignores close() and must be wrapped
|
||||
InputStream reallyCloseable = new BufferedInputStream(new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8)));
|
||||
return Response.builder().request(testRequest()).status(status).body(reallyCloseable, null).build();
|
||||
InputStream reallyCloseable = new BufferedInputStream(
|
||||
new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8)));
|
||||
return Response.builder().request(testRequest()).status(status)
|
||||
.body(reallyCloseable, null).build();
|
||||
|
||||
}
|
||||
|
||||
@@ -163,8 +165,8 @@ class RetryableFeignBlockingLoadBalancerClientTests {
|
||||
void shouldExposeResponseBodyOnRetry() throws IOException {
|
||||
properties.getRetryableStatusCodes().add(503);
|
||||
Request request = testRequest();
|
||||
when(delegate.execute(any(), any()))
|
||||
.thenReturn(testResponse(503, "foo"), testResponse(503, "foo"));
|
||||
when(delegate.execute(any(), any())).thenReturn(testResponse(503, "foo"),
|
||||
testResponse(503, "foo"));
|
||||
when(retryFactory.createRetryPolicy(any(), eq(loadBalancerClient)))
|
||||
.thenReturn(new BlockingLoadBalancedRetryPolicy("test",
|
||||
loadBalancerClient, properties));
|
||||
@@ -172,14 +174,14 @@ class RetryableFeignBlockingLoadBalancerClientTests {
|
||||
URI.create("http://test/path")))
|
||||
.thenReturn(URI.create("http://testhost:80/path"));
|
||||
|
||||
Response response = feignBlockingLoadBalancerClient.execute(request, new Request.Options());
|
||||
Response response = feignBlockingLoadBalancerClient.execute(request,
|
||||
new Request.Options());
|
||||
|
||||
String bodyContent = IOUtils.toString(response.body().asReader(StandardCharsets.UTF_8));
|
||||
String bodyContent = IOUtils
|
||||
.toString(response.body().asReader(StandardCharsets.UTF_8));
|
||||
assertThat(bodyContent).isEqualTo("foo");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
void shouldPassCorrectRequestToDelegate() throws IOException {
|
||||
Request request = testRequest();
|
||||
|
||||
+4
-8
@@ -241,8 +241,7 @@ public class FeignClientTests {
|
||||
|
||||
@Test
|
||||
public void testServiceId() {
|
||||
assertThat(testClientServiceId).as("testClientServiceId was null")
|
||||
.isNotNull();
|
||||
assertThat(testClientServiceId).as("testClientServiceId was null").isNotNull();
|
||||
final Hello hello = testClientServiceId.getHello();
|
||||
assertThat(hello).as("The hello response was null").isNotNull();
|
||||
assertThat(hello).as("first hello didn't match")
|
||||
@@ -481,8 +480,7 @@ public class FeignClientTests {
|
||||
Hello pojo2 = new Hello(OI_TERRA_2);
|
||||
MockMultipartFile file = new MockMultipartFile("file", "hello.bin", null,
|
||||
"hello".getBytes());
|
||||
String response = multipartClient.multipartPojo("abc", "123", pojo1, pojo2,
|
||||
file);
|
||||
String response = multipartClient.multipartPojo("abc", "123", pojo1, pojo2, file);
|
||||
assertThat(response).isEqualTo("abc123hello world 1oi terra 2hello.bin");
|
||||
}
|
||||
|
||||
@@ -507,8 +505,7 @@ public class FeignClientTests {
|
||||
"hello".getBytes());
|
||||
MockMultipartFile file2 = new MockMultipartFile("file2", "hello2.bin", null,
|
||||
"hello".getBytes());
|
||||
String response = multipartClient
|
||||
.requestPartListOfPojosAndListOfMultipartFiles(
|
||||
String response = multipartClient.requestPartListOfPojosAndListOfMultipartFiles(
|
||||
Arrays.asList(pojo1, pojo2), Arrays.asList(file1, file2));
|
||||
assertThat(response).isEqualTo("hello world 1oi terra 2hello1.binhello2.bin");
|
||||
}
|
||||
@@ -824,8 +821,7 @@ public class FeignClientTests {
|
||||
public HystrixClientWithFallBackFactory create(final Throwable cause) {
|
||||
return () -> {
|
||||
assertThat(cause).isNotNull().as("Cause was null");
|
||||
return new Hello(
|
||||
"Hello from the fallback side: " + cause.getMessage());
|
||||
return new Hello("Hello from the fallback side: " + cause.getMessage());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-dependencies-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>2.3.5.BUILD-SNAPSHOT</version>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-openfeign-dependencies</artifactId>
|
||||
<version>2.2.9.BUILD-SNAPSHOT</version>
|
||||
<version>2.2.9.RELEASE</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>spring-cloud-openfeign-dependencies</name>
|
||||
<description>Spring Cloud OpenFeign Dependencies</description>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-openfeign</artifactId>
|
||||
<version>2.2.9.BUILD-SNAPSHOT</version>
|
||||
<version>2.2.9.RELEASE</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user