@Test public void testErrorInOnCompletedPropagation() throws Exception { final RuntimeException expectedException = new RuntimeException("expected"); @SuppressWarnings("unchecked") final AsyncHandler<Object> handler = mock(AsyncHandler.class); when(handler.onCompleted()).thenThrow(expectedException); final Single<?> underTest = AsyncHttpSingle.create(bridge -> { try { bridge.onCompleted(); return mock(Future.class); } catch (final Throwable t) { throw new AssertionError(t); } }, () -> handler); final TestSubscriber<Object> subscriber = new TestSubscriber<>(); underTest.subscribe(subscriber); verify(handler).onCompleted(); verifyNoMoreInteractions(handler); subscriber.awaitTerminalEvent(); subscriber.assertTerminalEvent(); subscriber.assertNoValues(); subscriber.assertError(expectedException); }
public static Single<Response> create(BoundRequestBuilder builder) { requireNonNull(builder); return create(builder::execute, AsyncCompletionHandlerBase::new); }
AsyncHttpSingle { public static Single<Response> create(BoundRequestBuilder builder) { requireNonNull(builder); return create(builder::execute, AsyncCompletionHandlerBase::new); } }
AsyncHttpSingle { public static Single<Response> create(BoundRequestBuilder builder) { requireNonNull(builder); return create(builder::execute, AsyncCompletionHandlerBase::new); } private  AsyncHttpSingle(); }
AsyncHttpSingle { public static Single<Response> create(BoundRequestBuilder builder) { requireNonNull(builder); return create(builder::execute, AsyncCompletionHandlerBase::new); } private  AsyncHttpSingle(); static Single<Response> create(BoundRequestBuilder builder); static Single<Response> create(Func1<? super AsyncHandler<?>, ? extends Future<?>> requestTemplate); static Single<T> create(BoundRequestBuilder builder, Func0<? extends AsyncHandler<? extends T>> handlerSupplier); static Single<T> create(Func1<? super AsyncHandler<?>, ? extends Future<?>> requestTemplate,
                                     Func0<? extends AsyncHandler<? extends T>> handlerSupplier); }
AsyncHttpSingle { public static Single<Response> create(BoundRequestBuilder builder) { requireNonNull(builder); return create(builder::execute, AsyncCompletionHandlerBase::new); } private  AsyncHttpSingle(); static Single<Response> create(BoundRequestBuilder builder); static Single<Response> create(Func1<? super AsyncHandler<?>, ? extends Future<?>> requestTemplate); static Single<T> create(BoundRequestBuilder builder, Func0<? extends AsyncHandler<? extends T>> handlerSupplier); static Single<T> create(Func1<? super AsyncHandler<?>, ? extends Future<?>> requestTemplate,
                                     Func0<? extends AsyncHandler<? extends T>> handlerSupplier);  }