### Question:
JsonRpcDecoder extends ByteToMessageDecoder { public int getRecordsRead() { return recordsRead; } JsonRpcDecoder(final int maxFrameLength); int getRecordsRead();  }### Answer:
@Test public void testDecodePrettyJson() throws Exception { ch.writeInbound(copiedBuffer(prettyTestJson, CharsetUtil.UTF_8)); ch.readInbound(); assertEquals(1, decoder.getRecordsRead()); ch.finish(); }
@Test public void testDecodeSkipSpaces() throws Exception { ch.writeInbound(copiedBuffer(PREAMBLE + testJson + PREAMBLE + testJson, CharsetUtil.UTF_8)); ch.readInbound(); assertEquals(2, decoder.getRecordsRead()); ch.finish(); }
@Test public void testDecodePartial() throws Exception { ch.writeInbound(copiedBuffer(PARTIAL_START, CharsetUtil.UTF_8)); ch.readInbound(); Thread.sleep(10); ch.writeInbound(copiedBuffer(PARTIAL_END, CharsetUtil.UTF_8)); ch.readInbound(); assertEquals(1, decoder.getRecordsRead()); ch.finish(); }