Skip to content

Commit b951def

Browse files
committed
Force dumping stack trace in CLI integration tests
Integrate feedback from @david-waltermire in previous pairing session.
1 parent da2fa74 commit b951def

File tree

1 file changed

+10
-6
lines changed
  • metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli

1 file changed

+10
-6
lines changed

metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ private static Stream<Arguments> providesValues() {
7070
List<Arguments> values = new ArrayList<>();
7171
values.add(Arguments.of(new String[] {}, ExitCode.INVALID_COMMAND, noExpectedExceptionClass));
7272
values.add(Arguments.of(new String[] { "-h" }, ExitCode.OK, noExpectedExceptionClass));
73-
values.add(Arguments.of(new String[] { "generate-schema", "--help" }, ExitCode.INVALID_COMMAND,
74-
noExpectedExceptionClass));
75-
values.add(Arguments.of(new String[] { "validate", "--help" }, ExitCode.OK, noExpectedExceptionClass));
76-
values.add(Arguments.of(new String[] { "validate-content", "--help" }, ExitCode.INVALID_COMMAND,
73+
values
74+
.add(Arguments.of(new String[] { "generate-schema", "--help", "--show-stack-trace" }, ExitCode.INVALID_COMMAND,
75+
noExpectedExceptionClass));
76+
values.add(Arguments.of(new String[] { "validate", "--help", "--show-stack-trace" }, ExitCode.OK,
7777
noExpectedExceptionClass));
78+
values
79+
.add(Arguments.of(new String[] { "validate-content", "--help", "--show-stack-trace" }, ExitCode.INVALID_COMMAND,
80+
noExpectedExceptionClass));
7881
values.add(Arguments.of(
7982
new String[] { "validate",
80-
"../databind/src/test/resources/metaschema/fields_with_flags/metaschema.xml" },
83+
"../databind/src/test/resources/metaschema/fields_with_flags/metaschema.xml", "--show-stack-trace" },
8184
ExitCode.OK, noExpectedExceptionClass));
8285
values.add(Arguments.of(new String[] { "generate-schema", "--overwrite", "--as", "JSON",
8386
"../databind/src/test/resources/metaschema/fields_with_flags/metaschema.xml",
@@ -113,7 +116,8 @@ void testQueryCommand() {
113116
String[] args
114117
= new String[] { "query", "-m", "../databind/src/test/resources/metaschema/fields_with_flags/metaschema.xml",
115118
"-i",
116-
"../databind/src/test/resources/metaschema/fields_with_flags/example.json", "3 + 4 + 5" };
119+
"../databind/src/test/resources/metaschema/fields_with_flags/example.json", "3 + 4 + 5",
120+
"--show-stack-trace" };
117121
CLI.runCli(args);
118122
assertThat(logCaptor.getInfoLogs()).containsExactly("[12]");
119123
};

0 commit comments

Comments
 (0)