@Test
    public void shouldBeAbleToMockClient() throws Exception {
        final Client mockClient = mock(Client.class);
        final ResultSet mockResultSet = mock(ResultSet.class);
        final CompletableFuture<List<Result>> results = new CompletableFuture<>();
        results.complete(Arrays.asList(new Result(100), new Result(200), new Result(300)));
        when(mockResultSet.all()).thenReturn(results);
        when(mockClient.submit(anyString())).thenReturn(mockResultSet);

        final CompletableFuture<List<Result>> rs = mockClient.submit("g.V().count()").all();
        assertEquals(100, rs.get().get(0).getInt());
        assertEquals(200, rs.get().get(1).getInt());
        assertEquals(300, rs.get().get(2).getInt());
    }
This is an example of how to mock the {@link Client} for a script and how to return a specific {@link ResultSet}.
The problem with mocking here mostly has to do with having to try to mocking {@link ResultSet} which is marked
as {@code final}. Fortunately, mockito can mock such classes if your {@code src/test/resources/mockito-extensions}
has a file called {@code org.mockito.plugins.MockMaker} with the single line of {@code mock-maker-inline} in it.
Then, mocking works as normal.
gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/MockClientTest.java