@Test
    public void shouldAuthorizeGremlinLangRequest() {
        final Cluster cluster = TestClientFactory.build().auth(basic("marko", "rainbow-dash")).create();
        final GraphTraversalSource g = AnonymousTraversalSource.traversal().with(
                DriverRemoteConnection.using(cluster, "gmodern"));
        try {
            assertEquals(6, (long) g.V().count().next());
        } finally {
            cluster.close();
        }
    }
Configure Gremlin Server settings per test.
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthzIntegrateTest.java