AbstractClientConnection { final void poison(final RequestException cause) { final List<ConnectionEntry> entries; lock.lock(); try { entries = lockedPoison(cause); } finally { lock.unlock(); } poison(entries, cause); } private  AbstractClientConnection(final AbstractClientConnection<T> oldConn, final TransmitQueue newQueue,
            final String backendName);   AbstractClientConnection(final ClientActorContext context, final Long cookie, final String backendName,
            final int queueDepth);   AbstractClientConnection(final AbstractClientConnection<T> oldConn);   AbstractClientConnection(final AbstractClientConnection<T> oldConn, final T newBackend,
            final int queueDepth); final ClientActorContext context(); final @NonNull Long cookie(); final ActorRef localActor(); final long currentTime(); final void sendRequest(final Request<?, ?> request, final Consumer<Response<?, ?>> callback); final void enqueueRequest(final Request<?, ?> request, final Consumer<Response<?, ?>> callback,
            final long enqueuedTicks); final void enqueueEntry(final ConnectionEntry entry, final long now); abstract Optional<T> getBackendInfo(); @Override final String toString(); static final long DEFAULT_BACKEND_ALIVE_TIMEOUT_NANOS; static final long DEFAULT_REQUEST_TIMEOUT_NANOS; static final long DEFAULT_NO_PROGRESS_TIMEOUT_NANOS; }
@Test public void testPoison() { final Consumer<Response<?, ?>> callback = mock(Consumer.class); final Request<?, ?> request = createRequest(replyToProbe.ref()); final ConnectionEntry entry = new ConnectionEntry(request, callback, 0L); connection.enqueueEntry(entry, 0L); connection.poison(new RuntimeRequestException("fail", new RuntimeException("fail"))); verify(callback, timeout(1000)).accept(isA(TransactionFailure.class)); }