HttpsResponseSerializer extends ProtocolMessageSerializer<HttpsResponseMessage> { @Override public byte[] serializeProtocolMessageContent() { StringBuilder builder = new StringBuilder(); builder.append(message.getResponseProtocol().getValue()).append(" ") .append(message.getResponseStatusCode().getValue()).append("\r\n"); for (HttpsHeader header : message.getHeader()) { HttpsHeaderSerializer serializer = new HttpsHeaderSerializer(header); builder.append(new String(serializer.serialize())); } builder.append("\r\n"); builder.append(message.getResponseContent().getValue()); LOGGER.info(builder.toString()); appendBytes(builder.toString().getBytes()); return getAlreadySerialized(); } HttpsResponseSerializer(HttpsResponseMessage message, ProtocolVersion version); @Override byte[] serializeProtocolMessageContent();  }
@Test public void testSerializeProtocolMessageContent() { HttpsResponseParser parser = new HttpsResponseParser(0, msg, version, config); HttpsResponseMessage parsedMsg = parser.parse(); HttpsResponseSerializer serializer = new HttpsResponseSerializer(parsedMsg, version); assertArrayEquals(expPart, serializer.serialize()); }