Commit a913369d by Spencer Gibb

Upgrade feign version to 8.15.0

fixes gh-880
parent eed5a6f1
......@@ -74,6 +74,7 @@ import feign.Logger;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import rx.Observable;
import rx.Single;
/**
* @author Spencer Gibb
......@@ -116,6 +117,9 @@ public class FeignClientTests {
@RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello getHello();
@RequestMapping(method = RequestMethod.GET, value = "/hello")
Single<Hello> getHelloSingle();
@RequestMapping(method = RequestMethod.GET, value = "/hellos")
List<Hello> getHellos();
......@@ -179,6 +183,9 @@ public class FeignClientTests {
@FeignClient(name = "localapp3", fallback = HystrixClientFallback.class)
protected interface HystrixClient {
@RequestMapping(method = RequestMethod.GET, value = "/fail")
Single<Hello> failSingle();
@RequestMapping(method = RequestMethod.GET, value = "/fail")
Hello fail();
@RequestMapping(method = RequestMethod.GET, value = "/fail")
......@@ -198,13 +205,18 @@ public class FeignClientTests {
}
@Override
public Single<Hello> failSingle() {
return Single.just(new Hello("fallbacksingle"));
}
@Override
public HystrixCommand<Hello> failCommand() {
return new FallbackCommand<>(new Hello("fallbackcommand"));
}
@Override
public Observable<Hello> failObservable() {
return new FallbackCommand<>(new Hello("fallbackobservable")).observe();
return Observable.just(new Hello("fallbackobservable"));
}
@Override
......@@ -363,6 +375,15 @@ public class FeignClientTests {
}
@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() {
ResponseEntity response = testClient.noContent();
assertNotNull("response was null", response);
......@@ -401,7 +422,15 @@ public class FeignClientTests {
}
@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() {
HystrixCommand<Hello> command = hystrixClient.failCommand();
assertNotNull("command was null", command);
......@@ -411,7 +440,6 @@ public class FeignClientTests {
}
@Test
@Ignore("Until Observable works in fallback")
public void testHystrixFallbackObservable() {
Observable<Hello> observable = hystrixClient.failObservable();
assertNotNull("observable was null", observable);
......
......@@ -19,7 +19,7 @@
<spring-cloud-stream.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
<archaius.version>0.7.3</archaius.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>
<ribbon.version>2.1.0</ribbon.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