@Test
public void testDecode() throws Exception {

    BrpcHttpObjectDecoder decoder = BrpcHttpObjectDecoder.getDecoder(true);
    ChannelHandlerContext ctx = Mockito.mock(ChannelHandlerContext.class);
    when(ctx.alloc()).thenReturn(alloc);
    ByteBuf buf = alloc.buffer(1024);
    String[] testRequest = new String[]{
            "GET / HTTP/1.1",
            "Host: localhost",
            "Content-Length: 10",
            "",
            "1234567890"
    }; // full request
    buf.writeBytes(StringUtils.join(testRequest, "\n\r").getBytes(Charset.forName("UTF-8")));
    Object message = decoder.decode(ctx, buf);
    assertThat(message).isNotNull();
    ReferenceCountUtil.release(buf);
    ReferenceCountUtil.release(message);
}