Add elasticsearch cli test for options plus illegal args

This commit is contained in:
Ryan Ernst 2016-03-23 11:52:25 -07:00
parent f91a046b6f
commit 0fe6c9f3b4
1 changed files with 9 additions and 2 deletions

View File

@ -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 {