@Test(expected = AuthenticationException.class)
    public void shouldUseTinkerGraphForCredentialsStoreAndFail() throws Exception {
        final Map<String,Object> config = new HashMap<>();
        config.put(SimpleAuthenticator.CONFIG_CREDENTIALS_DB, "conf/tinkergraph-credentials.properties");
        authenticator.setup(config);

        final Authenticator.SaslNegotiator negotiator = authenticator.newSaslNegotiator(null);
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        final byte[] nul = new byte[] {0};
        stream.write(nul);
        stream.write("stephen".getBytes());
        stream.write(nul);
        stream.write("bad-password".getBytes());

        negotiator.evaluateResponse(stream.toByteArray());
        assertTrue(negotiator.isComplete());
        negotiator.getAuthenticatedUser();
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticatorTest.java