Commit a913369d by Spencer Gibb

Upgrade feign version to 8.15.0

fixes gh-880
parent eed5a6f1
...@@ -74,6 +74,7 @@ import feign.Logger; ...@@ -74,6 +74,7 @@ import feign.Logger;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import feign.RequestTemplate; import feign.RequestTemplate;
import rx.Observable; import rx.Observable;
import rx.Single;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
...@@ -116,6 +117,9 @@ public class FeignClientTests { ...@@ -116,6 +117,9 @@ public class FeignClientTests {
@RequestMapping(method = RequestMethod.GET, value = "/hello") @RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello getHello(); Hello getHello();
@RequestMapping(method = RequestMethod.GET, value = "/hello")
Single<Hello> getHelloSingle();
@RequestMapping(method = RequestMethod.GET, value = "/hellos") @RequestMapping(method = RequestMethod.GET, value = "/hellos")
List<Hello> getHellos(); List<Hello> getHellos();
...@@ -179,6 +183,9 @@ public class FeignClientTests { ...@@ -179,6 +183,9 @@ public class FeignClientTests {
@FeignClient(name = "localapp3", fallback = HystrixClientFallback.class) @FeignClient(name = "localapp3", fallback = HystrixClientFallback.class)
protected interface HystrixClient { protected interface HystrixClient {
@RequestMapping(method = RequestMethod.GET, value = "/fail") @RequestMapping(method = RequestMethod.GET, value = "/fail")
Single<Hello> failSingle();
@RequestMapping(method = RequestMethod.GET, value = "/fail")
Hello fail(); Hello fail();
@RequestMapping(method = RequestMethod.GET, value = "/fail") @RequestMapping(method = RequestMethod.GET, value = "/fail")
...@@ -198,13 +205,18 @@ public class FeignClientTests { ...@@ -198,13 +205,18 @@ public class FeignClientTests {
} }
@Override @Override
public Single<Hello> failSingle() {
return Single.just(new Hello("fallbacksingle"));
}
@Override
public HystrixCommand<Hello> failCommand() { public HystrixCommand<Hello> failCommand() {
return new FallbackCommand<>(new Hello("fallbackcommand")); return new FallbackCommand<>(new Hello("fallbackcommand"));
} }
@Override @Override
public Observable<Hello> failObservable() { public Observable<Hello> failObservable() {
return new FallbackCommand<>(new Hello("fallbackobservable")).observe(); return Observable.just(new Hello("fallbackobservable"));
} }
@Override @Override
...@@ -363,6 +375,15 @@ public class FeignClientTests { ...@@ -363,6 +375,15 @@ public class FeignClientTests {
} }
@Test @Test
public void testSingle() {
Single<Hello> single = this.testClient.getHelloSingle();
assertNotNull("single was null", single);
Hello hello = single.toBlocking().value();
assertNotNull("hello was null", hello);
assertEquals("first hello didn't match", new Hello(HELLO_WORLD_1), hello);
}
@Test
public void testNoContentResponse() { public void testNoContentResponse() {
ResponseEntity response = testClient.noContent(); ResponseEntity response = testClient.noContent();
assertNotNull("response was null", response); assertNotNull("response was null", response);
...@@ -401,7 +422,15 @@ public class FeignClientTests { ...@@ -401,7 +422,15 @@ public class FeignClientTests {
} }
@Test @Test
@Ignore("Until HystrixCommand works in fallback") public void testHystrixFallbackSingle() {
Single<Hello> single = hystrixClient.failSingle();
assertNotNull("single was null", single);
Hello hello = single.toBlocking().value();
assertNotNull("hello was null", hello);
assertEquals("message was wrong", "fallbacksingle", hello.getMessage());
}
@Test
public void testHystrixFallbackCommand() { public void testHystrixFallbackCommand() {
HystrixCommand<Hello> command = hystrixClient.failCommand(); HystrixCommand<Hello> command = hystrixClient.failCommand();
assertNotNull("command was null", command); assertNotNull("command was null", command);
...@@ -411,7 +440,6 @@ public class FeignClientTests { ...@@ -411,7 +440,6 @@ public class FeignClientTests {
} }
@Test @Test
@Ignore("Until Observable works in fallback")
public void testHystrixFallbackObservable() { public void testHystrixFallbackObservable() {
Observable<Hello> observable = hystrixClient.failObservable(); Observable<Hello> observable = hystrixClient.failObservable();
assertNotNull("observable was null", observable); assertNotNull("observable was null", observable);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<spring-cloud-stream.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version> <spring-cloud-stream.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
<archaius.version>0.7.3</archaius.version> <archaius.version>0.7.3</archaius.version>
<eureka.version>1.4.2</eureka.version> <eureka.version>1.4.2</eureka.version>
<feign.version>8.14.4</feign.version> <feign.version>8.15.0</feign.version>
<hystrix.version>1.4.24</hystrix.version> <hystrix.version>1.4.24</hystrix.version>
<ribbon.version>2.1.0</ribbon.version> <ribbon.version>2.1.0</ribbon.version>
<servo.version>0.10.1</servo.version> <servo.version>0.10.1</servo.version>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment