TlsAttackerSocket { public byte[] receiveRawBytes() throws IOException { return state.getTlsContext().getTransportHandler().fetchData(); } TlsAttackerSocket(State state); void sendRawBytes(byte[] bytes); byte[] receiveRawBytes(); void send(String string); void send(byte[] bytes); byte[] receiveBytes(); String receiveString(); void send(ProtocolMessage message); void close();  }
@Test public void testReceiveRawBytes() throws Exception { transportHandler.setFetchableByte(new byte[] { 1, 2, 3 }); byte[] received = socket.receiveRawBytes(); assertArrayEquals(new byte[] { 1, 2, 3 }, received); }