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