You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/10/08 21:34:41 UTC
[3/9] incubator-tinkerpop git commit: Added fail() conditions to
authentication tests for Gremlin Server.
Added fail() conditions to authentication tests for Gremlin Server.
The tests weren't fully asserting what they were supposed to be asserting with out this change.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/3f945807
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/3f945807
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/3f945807
Branch: refs/heads/master
Commit: 3f94580781179d165b3cc73e9d4ebcc71f981062
Parents: 8eb71e1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Oct 8 14:05:14 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 8 14:05:14 2015 -0400
----------------------------------------------------------------------
.../server/GremlinServerAuthIntegrateTest.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3f945807/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 39ec6c1..7f6c3bf 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -24,13 +24,17 @@ import org.apache.tinkerpop.gremlin.driver.Cluster;
import org.apache.tinkerpop.gremlin.driver.exception.ResponseException;
import org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator;
import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.ietf.jgss.GSSException;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import org.apache.tinkerpop.gremlin.driver.ser.Serializers;
+import static org.hamcrest.CoreMatchers.startsWith;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
@@ -101,11 +105,12 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
final Client client = cluster.connect();
try {
- client.submit("1+1").all();
+ client.submit("1+1").all().get();
+ fail("This should not succeed as the client did not provide credentials");
} catch(Exception ex) {
final Throwable root = ExceptionUtils.getRootCause(ex);
- assertEquals(ResponseException.class, root.getClass());
- assertEquals("Username and/or password are incorrect", root.getMessage());
+ assertEquals(GSSException.class, root.getClass());
+ assertThat(root.getMessage(), startsWith("Invalid name provided"));
} finally {
cluster.close();
}
@@ -117,7 +122,8 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
final Client client = cluster.connect();
try {
- client.submit("1+1").all();
+ client.submit("1+1").all().get();
+ fail("This should not succeed as the client did not provide valid credentials");
} catch(Exception ex) {
final Throwable root = ExceptionUtils.getRootCause(ex);
assertEquals(ResponseException.class, root.getClass());