@Test
    public void shouldNotAuditLogWhenDisabled() throws Exception {
        final String username = "stephen";
        final String password = "password";

        final Cluster cluster = TestClientFactory.build(kdcServer.gremlinHostname).auth(basic(username, password)).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);

        final String simpleAuthenticatorName = SimpleAuthenticator.class.getSimpleName();
        assertFalse(logCaptor.getLogs().stream().anyMatch(m -> m.matches(
                String.format("User %s with address .+? authenticated by %s", username, simpleAuthenticatorName))));
        assertFalse(logCaptor.getLogs().stream().anyMatch(m -> m.matches(
                "User stephen with address .+? requested: g.inject\\(2\\)")));
        assertFalse(logCaptor.getLogs().stream().anyMatch(m -> m.matches(
                "User stephen with address .+? requested: g.inject\\(3\\)")));
        assertFalse(logCaptor.getLogs().stream().anyMatch(m -> m.matches(
                "User stephen with address .+? requested: g.inject\\(4\\)")));
    }
Configure specific Gremlin Server settings for specific tests.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuditLogIntegrateTest.java