@Test
    public void shouldAuditLogWithAllowAllAuthenticator() throws Exception {

        final Cluster cluster = TestClientFactory.build(kdcServer.gremlinHostname).create();
        final Client client = cluster.connect();

        try {
            assertEquals(2, client.submit("g.inject(2)").all().get().get(0).getInt());
            assertEquals(3, client.submit("g.inject(3)").all().get().get(0).getInt());
            assertEquals(4, client.submit("g.inject(4)").all().get().get(0).getInt());
        } finally {
            cluster.close();
        }

        // wait for logger to flush - (don't think there is a way to detect this)
        stopServer();
        Thread.sleep(1000);

        // WebSocketChannelizer does not add SaslAuthenticationHandler for AllowAllAuthenticator,
        // so no authenticated user log line available
        assertTrue(logCaptor.getLogs().stream().anyMatch(m -> m.matches(String.format(
                "User %s with address .+? requested: g.inject\\(2\\)", AuthenticatedUser.ANONYMOUS_USERNAME))));
        assertTrue(logCaptor.getLogs().stream().anyMatch(m -> m.matches(String.format(
                "User %s with address .+? requested: g.inject\\(3\\)", AuthenticatedUser.ANONYMOUS_USERNAME))));
        assertTrue(logCaptor.getLogs().stream().anyMatch(m -> m.matches(String.format(
                "User %s with address .+? requested: g.inject\\(4\\)", AuthenticatedUser.ANONYMOUS_USERNAME))));
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java