@Test
    public void shouldErrorOnGremlinFromApplicationJsonPostRequest() throws Exception {
        final GremlinLang gremlin = EmptyGraph.instance().traversal().V().asAdmin().getGremlinLang();
        final UUID requestId = UUID.fromString("1e55c495-22d5-4a39-934a-a2744ba010ef");
        final String body = "{ \"gremlin\": \"" + gremlin + "\", \"g\": \"gmodern" + "\", \"language\":  \"gremlin-lang\"}";
        final CloseableHttpClient httpclient = HttpClients.createDefault();
        final HttpPost httppost = new HttpPost(TestClientFactory.createURLString());
        httppost.addHeader("Content-Type", "application/json");
        httppost.setEntity(new StringEntity(body, Consts.UTF_8));

        try (final CloseableHttpResponse response = httpclient.execute(httppost)) {
            assertEquals(200, response.getStatusLine().getStatusCode());
            final JsonNode node = mapper.readTree(EntityUtils.toString(response.getEntity()));
            assertTrue(node.get("status").get("message").asText().contains("Failed to interpret Gremlin query"));
        }
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java