RenegotiationInfoExtensionSerializer extends ExtensionSerializer<RenegotiationInfoExtensionMessage> { @Override public byte[] serializeExtensionContent() { appendInt(message.getRenegotiationInfoLength().getValue(), ExtensionByteLength.RENEGOTIATION_INFO); appendBytes(message.getRenegotiationInfo().getValue()); LOGGER.debug("Serialized RenegotiationInfo extension with info of length " + message.getRenegotiationInfo().getValue().length); return getAlreadySerialized(); } RenegotiationInfoExtensionSerializer(RenegotiationInfoExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { RenegotiationInfoExtensionMessage message = new RenegotiationInfoExtensionMessage(); message.setExtensionType(extensionType.getValue()); message.setExtensionLength(extensionLength); message.setRenegotiationInfo(extensionPayload); message.setRenegotiationInfoLength(extensionPayloadLength); RenegotiationInfoExtensionSerializer serializer = new RenegotiationInfoExtensionSerializer(message); assertArrayEquals(expectedBytes, serializer.serialize()); }