From 0fe6c9f3b47f2380e607640b6126c17d146eb5a5 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 23 Mar 2016 11:52:25 -0700 Subject: [PATCH] Add elasticsearch cli test for options plus illegal args --- .../bootstrap/ElasticsearchCliTests.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java b/core/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java index 96ef26eacc6..632646146fe 100644 --- a/core/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java +++ b/core/src/test/java/org/elasticsearch/bootstrap/ElasticsearchCliTests.java @@ -80,17 +80,24 @@ public class ElasticsearchCliTests extends ESTestCase { runTest( ExitCodes.USAGE, false, - output -> assertThat(output, containsString("Positional args not allowed, found [foo]")), + output -> assertThat(output, containsString("Positional arguments not allowed, found [foo]")), (foreground, pidFile, esSettings) -> {}, "foo" ); runTest( ExitCodes.USAGE, false, - output -> assertThat(output, containsString("Positional args not allowed, found [foo, bar]")), + output -> assertThat(output, containsString("Positional arguments not allowed, found [foo, bar]")), (foreground, pidFile, esSettings) -> {}, "foo", "bar" ); + runTest( + ExitCodes.USAGE, + false, + output -> assertThat(output, containsString("Positional arguments not allowed, found [foo]")), + (foreground, pidFile, esSettings) -> {}, + "-E", "something", "foo", "-E", "somethingelse" + ); } public void testThatPidFileCanBeConfigured() throws Exception {