@ -51,6 +51,18 @@ public class HystrixBuilderTest {
@@ -51,6 +51,18 @@ public class HystrixBuilderTest {
@Rule
public final MockWebServer server = new MockWebServer ( ) ;
@Test
public void defaultMethodReturningHystrixCommand ( ) {
server . enqueue ( new MockResponse ( ) . setBody ( "\"foo\"" ) ) ;
TestInterface api = target ( ) ;
HystrixCommand < String > command = api . defaultMethodReturningCommand ( ) ;
assertThat ( command ) . isNotNull ( ) ;
assertThat ( command . execute ( ) ) . isEqualTo ( "foo" ) ;
}
@Test
public void hystrixCommand ( ) {
server . enqueue ( new MockResponse ( ) . setBody ( "\"foo\"" ) ) ;
@ -606,6 +618,10 @@ public class HystrixBuilderTest {
@@ -606,6 +618,10 @@ public class HystrixBuilderTest {
@Headers ( "Accept: application/json" )
HystrixCommand < String > command ( ) ;
default HystrixCommand < String > defaultMethodReturningCommand ( ) {
return command ( ) ;
}
@RequestLine ( "GET /" )
@Headers ( "Accept: application/json" )
HystrixCommand < Integer > intCommand ( ) ;