byte[] baddata = new byte[]{1,2};
ChannelBuffer buffer = ChannelBuffers.wrappedBuffer(join(request, baddata));
Response obj = (Response)codec.decode(channel, buffer);
Assert.assertEquals(person, obj.getResult());
//only decode necessary bytes
Assert.assertEquals(request.length, buffer.readerIndex());
}
@Test
public void test_Decode_Error_Response_Object() throws IOException{
//00000010-response/oneway/hearbeat=true |20-stats=ok|id=0|length=0
byte[] header = new byte[] { MAGIC_HIGH, MAGIC_LOW, 0x20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };