assertThat(response.isSuccessful()).isFalse();
assertThat(response.errorBody().string()).isEqualTo("Hi");
}</BUG>
@Test public void responseFailure() {
<BUG>server.enqueue(new MockResponse().setSocketPolicy(DISCONNECT_AFTER_REQUEST));
BlockingObservable<Response<String>> o = service.response().toBlocking();
try {
o.first();
fail();
} catch (RuntimeException t) {
assertThat(t.getCause()).isInstanceOf(IOException.class);
}</BUG>
}

assertThat(response.isSuccessful()).isFalse();
assertThat(response.errorBody().string()).isEqualTo("Hi");
subscriber.assertCompleted();
}
@Test public void responseFailure() {
server.enqueue(new MockResponse().setSocketPolicy(DISCONNECT_AFTER_REQUEST));
TestSubscriber<Response<String>> subscriber = new TestSubscriber<>();
service.response().subscribe(subscriber);
subscriber.assertNoValues();
subscriber.assertError(IOException.class);
}
