DefaultOutboundBufferMonitor implements OutboundBufferMonitor { @Override public long getOutboundBufferCumulation() { return trackOutboundBuffer(session.getChannel()); } DefaultOutboundBufferMonitor(Session session); @Override long getOutboundBufferCumulation(); final static long UNKNOWN_OUTBOUND_BUFFER; }
@Test public void testGetOutboundBufferCumulation() { Channel channel = mockChannel(); when(channel.isActive()).thenReturn(false); when(session.getChannel()).thenReturn(channel); long outboundBufferSize = monitor.getOutboundBufferCumulation(); Assert.assertEquals(-1L, outboundBufferSize); }