PWDClearExtensionSerializer extends ExtensionSerializer<PWDClearExtensionMessage> { @Override public byte[] serializeExtensionContent() { LOGGER.debug("Serializing PWDClearExtensionMessage"); writeUsernameLength(msg); writeUsername(msg); return getAlreadySerialized(); } PWDClearExtensionSerializer(PWDClearExtensionMessage message); @Override byte[] serializeExtensionContent();  }
@Test public void testSerializeExtensionContent() { message.setExtensionType(type.getValue()); message.setExtensionLength(extensionLength); message.setUsername(username); message.setUsernameLength(usernameLength); assertArrayEquals(expectedBytes, serializer.serialize()); }