### Question:
GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> { @Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(GetConfigOutput message, ByteBuf outBuffer);  }### Answer:
@Test public void testSerialize() throws Exception { GetConfigOutputBuilder builder = new GetConfigOutputBuilder(); BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); builder.setFlags(SwitchConfigFlag.forValue(2)); builder.setMissSendLen(20); GetConfigOutput message = builder.build(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); factory.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 12); Assert.assertEquals("Wrong Type", message.getFlags().getIntValue(), serializedBuffer.readShort()); Assert.assertEquals("Wrong Code", message.getMissSendLen().intValue(), serializedBuffer.readShort()); }
@Test public void testSerialize() { GetConfigReplyMessageFactory serializer = new GetConfigReplyMessageFactory(); SerializerRegistry registry = new NetIdeSerializerRegistryImpl(); registry.init(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 12); Assert.assertEquals("Wrong Type", message.getFlags().getIntValue(), serializedBuffer.readShort()); Assert.assertEquals("Wrong Code", message.getMissSendLen().intValue(), serializedBuffer.readShort()); }