UnconnectedDataItemResponse extends CpfItem { public ByteBuf getData() { return data; } UnconnectedDataItemResponse(ByteBuf data); ByteBuf getData(); @Override boolean equals(Object o); @Override int hashCode(); static ByteBuf encode(UnconnectedDataItemResponse item, ByteBuf buffer); static UnconnectedDataItemResponse decode(ByteBuf buffer); static final int TYPE_ID; }
@Test(dataProvider = "getData") public void testSerialization(ByteBuf data) { data.retain(); data.markReaderIndex(); UnconnectedDataItemResponse item = new UnconnectedDataItemResponse(data); UnconnectedDataItemResponse decoded = encodeDecode(item, UnconnectedDataItemResponse::encode, UnconnectedDataItemResponse::decode); data.resetReaderIndex(); assertEquals(item, decoded); data.release(); decoded.getData().release(); }