CopyBufferedRecordsAction extends CopyContextFieldAction { @Override protected void copyField(TlsContext src, TlsContext dst) { dst.setRecordBuffer(src.getRecordBuffer()); } CopyBufferedRecordsAction();  CopyBufferedRecordsAction(String srcConnectionAlias, String dstConnectionAlias); @Override boolean executedAsPlanned(); @Override void reset();  }
@Test public void testCopyField() { TlsContext src = new TlsContext(); TlsContext dst = new TlsContext(); ModifiableByteArray byteArray = new ModifiableByteArray(); AbstractRecord record = new Record(); LinkedList<AbstractRecord> recordBuffer = new LinkedList<>(); record.setProtocolMessageBytes(byteArray); record.setContentMessageType(ProtocolMessageType.HANDSHAKE); record.setMaxRecordLengthConfig(18); record.setCleanProtocolMessageBytes(new byte[1]); record.setCompleteRecordBytes(new byte[1]); recordBuffer.add(record); src.setRecordBuffer(recordBuffer); action.copyField(src, dst); assertSame(src.getRecordBuffer(), dst.getRecordBuffer()); }