DefaultHttp2RemoteFlowController implements Http2RemoteFlowController { @Override public void writePendingBytes() throws Http2Exception { monitor.writePendingBytes(); } DefaultHttp2RemoteFlowController(Http2Connection connection);  DefaultHttp2RemoteFlowController(Http2Connection connection,
                                            StreamByteDistributor streamByteDistributor);  DefaultHttp2RemoteFlowController(Http2Connection connection, final Listener listener);  DefaultHttp2RemoteFlowController(Http2Connection connection,
                                            StreamByteDistributor streamByteDistributor,
                                            final Listener listener); @Override void channelHandlerContext(ChannelHandlerContext ctx); @Override ChannelHandlerContext channelHandlerContext(); @Override void initialWindowSize(int newWindowSize); @Override int initialWindowSize(); @Override int windowSize(Http2Stream stream); @Override boolean isWritable(Http2Stream stream); @Override void channelWritabilityChanged(); @Override void updateDependencyTree(int childStreamId, int parentStreamId, short weight, boolean exclusive); @Override void listener(Listener listener); @Override void incrementWindowSize(Http2Stream stream, int delta); @Override void addFlowControlled(Http2Stream stream, FlowControlled frame); @Override boolean hasFlowControlled(Http2Stream stream); @Override void writePendingBytes();  }
@Test public void payloadSmallerThanWindowShouldBeWrittenImmediately() throws Http2Exception { FakeFlowControlled data = new FakeFlowControlled(5); sendData(STREAM_A, data); data.assertNotWritten(); verifyZeroInteractions(listener); controller.writePendingBytes(); data.assertFullyWritten(); verifyZeroInteractions(listener); }
@Test public void emptyPayloadShouldBeWrittenImmediately() throws Http2Exception { FakeFlowControlled data = new FakeFlowControlled(0); sendData(STREAM_A, data); data.assertNotWritten(); controller.writePendingBytes(); data.assertFullyWritten(); verifyZeroInteractions(listener); }