HttpStreamReader implements Subscriber<HttpObject> { @Override public void onComplete() { if (cancelled) { return; } closeDeframer(); } HttpStreamReader(DecompressorRegistry decompressorRegistry,
                            ArmeriaMessageDeframer deframer,
                            TransportStatusListener transportStatusListener); void request(int numMessages); @Override void onSubscribe(Subscription subscription); @Override void onNext(HttpObject obj); @Override void onError(Throwable cause); @Override void onComplete(); void cancel(); @VisibleForTesting
    final ArmeriaMessageDeframer deframer; }
@Test public void clientDone() throws Exception { reader.onComplete(); verify(deframer).deframe(HttpData.empty(), true); verify(deframer).closeWhenComplete(); }
@Test public void onComplete_when_deframer_isClosing() { when(deframer.isClosing()).thenReturn(true); reader.onComplete(); verify(deframer, never()).deframe(HttpData.empty(), true); verify(deframer, never()).closeWhenComplete(); }