@Test
    void rpcReply() throws Exception {
        final String request =
                "{\n" +
                "  \"method\" : \"doDebug\",\n" +
                "  \"type\" : \"REPLY\",\n" +
                "  \"seqid\" : 100,\n" +
                "  \"args\" : {\n" +
                "    \"success\" : {\n" +
                "      \"response\" : \"Nice response\"\n" +
                "    }\n" +
                "  }\n" +
                '}';

        TTextProtocol prot = new TTextProtocol(
                new TIOStreamTransport(new ByteArrayInputStream(request.getBytes())));
        final TMessage header = prot.readMessageBegin();
        final doDebug_result result = new doDebug_result();
        result.read(prot);
        prot.readMessageEnd();

        assertThat(header.name).isEqualTo("doDebug");
        assertThat(header.type).isEqualTo(TMessageType.REPLY);
        assertThat(header.seqid).isEqualTo(100);

        assertThat(result.getSuccess().getResponse()).isEqualTo("Nice response");

        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        prot = new TTextProtocol(new TIOStreamTransport(outputStream));
        prot.writeMessageBegin(header);
        result.write(prot);
        prot.writeMessageEnd();

        assertThatJson(new String(outputStream.toByteArray(), StandardCharsets.UTF_8)).isEqualTo(request);
    }
Read in (deserialize) a thrift message in TTextProtocol format
from a file on disk, then serialize it back out to a string.
Finally, deserialize that string and compare to the original
message.
thrift/thrift0.13/src/test/java/com/linecorp/armeria/common/thrift/text/TTextProtocolTest.java