Skip to content

Commit 5e0286a

Browse files
committed
Delayed tagging #2 (tests fix)
1 parent 779c2b7 commit 5e0286a

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

src/test/java/org/scm4j/releaser/cli/CLITest.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ public void testExceptionUnknownCommand() throws Exception {
143143
}
144144

145145
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
146-
147146
verify(mockedPS).println(thrown.getMessage());
148147
verify(mockedPS).println(CommandLine.getUsage());
149148

@@ -164,7 +163,6 @@ public void testExceptionNoCommand() throws Exception {
164163
}
165164

166165
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
167-
168166
verify(mockedPS).println(thrown.getMessage());
169167
verify(mockedPS).println(CommandLine.getUsage());
170168

@@ -185,7 +183,6 @@ public void testExceptionNoProduct() throws Exception {
185183
}
186184

187185
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
188-
189186
verify(mockedPS).println(thrown.getMessage());
190187
verify(mockedPS).println(CommandLine.getUsage());
191188

@@ -206,10 +203,9 @@ public void testExceptionUnknownOption() throws Exception {
206203
}
207204

208205
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
209-
210206
verify(mockedPS).println(thrown.getMessage());
211207
verify(mockedPS).println(CommandLine.getUsage());
212-
208+
213209
exit.expectSystemExitWithStatus(CLI.EXIT_CODE_ERROR);
214210
CLI.main(args);
215211
}
@@ -222,19 +218,20 @@ public void testExceptionUnknownComponent() throws Exception {
222218
CLI.setReleaser(new SCMReleaser());
223219
try (TestEnvironment te = new TestEnvironment()) {
224220
te.generateTestEnvironmentNoVCS();
225-
new CLI().getActionTree(cmd);
226-
fail();
227-
} catch (EComponentConfig e) {
228-
thrown = e;
221+
try {
222+
new CLI().getActionTree(cmd);
223+
fail();
224+
} catch (EComponentConfig e) {
225+
thrown = e;
226+
}
227+
228+
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
229+
verify(mockedPS).println(thrown.getMessage());
230+
verify(mockedPS, never()).println(CommandLine.getUsage());
231+
232+
exit.expectSystemExitWithStatus(CLI.EXIT_CODE_ERROR);
233+
CLI.main(args);
229234
}
230-
231-
assertEquals(CLI.EXIT_CODE_ERROR, mockedCLI.exec(args));
232-
233-
verify(mockedPS).println(thrown.getMessage());
234-
verify(mockedPS, never()).println(CommandLine.getUsage());
235-
236-
exit.expectSystemExitWithStatus(CLI.EXIT_CODE_ERROR);
237-
CLI.main(args);
238235
}
239236

240237
@Test

0 commit comments

Comments
 (0)