@Test public void testAbort() throws Exception { final TestSubscriber<Response> subscriber = new TestSubscriber<>(); try (AsyncHttpClient client = asyncHttpClient()) { final Single<Response> underTest = AsyncHttpSingle.create(client.prepareGet("http: () -> new AsyncCompletionHandlerBase() { @Override public State onStatusReceived(HttpResponseStatus status) { return State.ABORT; } }); underTest.subscribe(subscriber); subscriber.awaitTerminalEvent(); } subscriber.assertTerminalEvent(); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(null); }
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);  }