diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index c28ec099709e..9b47eca05f5f 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -338,9 +338,9 @@ private NodeProbe connect() try { if (username.isEmpty()) - nodeClient = new NodeProbe(host, parseInt(port)); + nodeClient = nodeProbeFactory.create(host, parseInt(port)); else - nodeClient = new NodeProbe(host, parseInt(port), username, password); + nodeClient = nodeProbeFactory.create(host, parseInt(port), username, password); } catch (IOException | SecurityException e) { Throwable rootCause = Throwables.getRootCause(e); diff --git a/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java b/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java index d2d4bb914dde..e209d1d413b8 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java @@ -32,6 +32,7 @@ public void test() throws Throwable try (Cluster cluster = init(Cluster.create(1))) { assertEquals(0, cluster.get(1).nodetool("help")); + assertEquals(0, cluster.get(1).nodetool("flush")); assertEquals(1, cluster.get(1).nodetool("not_a_legal_command")); } }