@Test public void testFrameWriterLogsFramesToSystem() { transport.trace(2); TransportImpl spy = Mockito.spy(transport); Transfer transfer = createTransfer(); FrameWriter framer = new FrameWriter(encoder, Integer.MAX_VALUE, (byte) 0, spy); int channel = 16; int payloadLength = littlePayload.capacity(); framer.writeFrame(channel, transfer, littlePayload, new PartialTransferHandler(transfer)); ArgumentCaptor<TransportFrame> frameCatcher = ArgumentCaptor.forClass(TransportFrame.class); Mockito.verify(spy).log(eq(TransportImpl.OUTGOING), frameCatcher.capture()); assertEquals(channel, frameCatcher.getValue().getChannel()); assertTrue(frameCatcher.getValue().getBody() instanceof Transfer); Binary payload = frameCatcher.getValue().getPayload(); assertEquals(payloadLength, payload.getLength()); }
void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport); }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);  }
FrameWriter { void writeFrame(Object frameBody) { writeFrame(0, frameBody, null, null); } FrameWriter(EncoderImpl encoder, int maxFrameSize, byte frameType, TransportImpl transport);   }