use of rx.Completable in project feign by OpenFeign.
the class HystrixBuilderTest method rxCompletableFallback.
@Test
public void rxCompletableFallback() {
server.enqueue(new MockResponse().setResponseCode(500));
final TestInterface api = target();
final Completable completable = api.completable();
assertThat(completable).isNotNull();
assertThat(server.getRequestCount()).isEqualTo(0);
final TestSubscriber<String> testSubscriber = new TestSubscriber<String>();
completable.subscribe(testSubscriber);
testSubscriber.awaitTerminalEvent();
testSubscriber.assertCompleted();
}
use of rx.Completable in project feign by OpenFeign.
the class HystrixBuilderTest method rxCompletableEmptyBody.
@Test
public void rxCompletableEmptyBody() {
server.enqueue(new MockResponse());
final TestInterface api = target();
final Completable completable = api.completable();
assertThat(completable).isNotNull();
assertThat(server.getRequestCount()).isEqualTo(0);
final TestSubscriber<String> testSubscriber = new TestSubscriber<String>();
completable.subscribe(testSubscriber);
testSubscriber.awaitTerminalEvent();
testSubscriber.assertCompleted();
testSubscriber.assertNoErrors();
}
Aggregations