@Test
    public void should200OnPOSTWithChunkedResponse() throws Exception {
        final CloseableHttpClient httpclient = HttpClients.createDefault();
        final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
        httppost.addHeader("Content-Type", "application/json");
        // chunk size is 8, so should be 2 chunks
        httppost.setEntity(new StringEntity("{\"gremlin\":\"g.inject(0,1,2,3,4,5,6,7,8,9,'ten',11,12,13,14,15,'new chunk')\"}", Consts.UTF_8));

        try (final CloseableHttpResponse response = httpclient.execute(httppost)) {
            assertEquals(200, response.getStatusLine().getStatusCode());
            assertTrue(response.getEntity().isChunked());

            final String json = EntityUtils.toString(response.getEntity());
            final JsonNode node = mapper.readTree(json);
            assertEquals(8, node.get("result").get(TOKEN_DATA).get(GraphSONTokens.VALUEPROP).get(8).get(GraphSONTokens.VALUEPROP).intValue());
            assertEquals("ten", node.get("result").get(TOKEN_DATA).get(GraphSONTokens.VALUEPROP).get(10).textValue());
            assertEquals("new chunk", node.get("result").get(TOKEN_DATA).get(GraphSONTokens.VALUEPROP).get(16).textValue());

            final Header[] footers = getTrailingHeaders(response);
            assertEquals(1, footers.length);
            assertEquals("code", footers[0].getName());
            assertEquals("200", footers[0].getValue());
        }
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java