PWDClearExtensionParser extends ExtensionParser<PWDClearExtensionMessage> { @Override public void parseExtensionMessageContent(PWDClearExtensionMessage msg) { LOGGER.debug("Parsing PWDClearExtensionMessage"); parseUsernameLength(msg); parseUsername(msg); } PWDClearExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(PWDClearExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { PWDClearExtensionParser parser = new PWDClearExtensionParser(start, expectedBytes); PWDClearExtensionMessage msg = parser.parse(); assertArrayEquals(type.getValue(), msg.getExtensionType().getValue()); assertEquals(extensionLength, (long) msg.getExtensionLength().getValue()); assertEquals(usernameLength, (long) msg.getUsernameLength().getValue()); assertEquals(username, msg.getUsername().getValue()); }