@Test
public void httpAndJsonDecoders() {

	EmbeddedChannel channel = new EmbeddedChannel();
	Connection testContext = () -> channel;
	ChannelHandler handler = new JsonObjectDecoder(true);
	testContext.addHandlerLast("foo", handler);
	HttpOperations.autoAddHttpExtractor(testContext, "foo", handler);
	String json1 = "[{\"some\": 1} , {\"valu";
	String json2 = "e\": true, \"test\": 1}]";
	Object[] content = new Object[3];
	content[0] = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
	content[1] =
			new DefaultHttpContent(Unpooled.copiedBuffer(json1, CharsetUtil.UTF_8));
	content[2] = new DefaultLastHttpContent(Unpooled.copiedBuffer(json2,
			CharsetUtil.UTF_8));
	channel.writeInbound(content);
	Object t = channel.readInbound();
	MatcherAssert.assertThat(t, instanceOf(HttpResponse.class));
	MatcherAssert.assertThat(t, not(instanceOf(HttpContent.class)));
	t = channel.readInbound();
	MatcherAssert.assertThat(t, instanceOf(ByteBuf.class));
	ByteBuf b = (ByteBuf) t;
	MatcherAssert.assertThat(b.readCharSequence(b.readableBytes(), CharsetUtil.UTF_8),
			is("{\"some\": 1}"));
	b.release();
	t = channel.readInbound();
	MatcherAssert.assertThat(t, instanceOf(ByteBuf.class));
	b = (ByteBuf) t;
	MatcherAssert.assertThat(b.readCharSequence(b.readableBytes(), CharsetUtil.UTF_8),
			is("{\"value\": true, \"test\": 1}"));
	b.release();
	t = channel.readInbound();
	MatcherAssert.assertThat(t, is(LastHttpContent.EMPTY_LAST_CONTENT));
	((LastHttpContent) t).release();
	t = channel.readInbound();
	MatcherAssert.assertThat(t, nullValue());
}