Skip to content

Commit 80de954

Browse files
committed
fix: Fix failing unit test cause by moving endSession in finally block
1 parent 172f8a5 commit 80de954

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/dev/dochia/cli/core/command/TestCommandTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ void shouldNotRunWhenNotRecognizedContentType() throws Exception {
113113
}
114114

115115
@Test
116-
void shouldNotCallEndSessionWhenIOException() {
116+
void shouldCallEndSessionWhenIOException() {
117117
ReflectionTestUtils.setField(apiArguments, "contract", "src/test/resources/not_existent.yml");
118118
ReflectionTestUtils.setField(apiArguments, "server", "http://localhost:8080");
119119

120120
testCommand.run();
121121
Mockito.verify(testCaseListener, Mockito.times(1)).startSession();
122-
Mockito.verify(testCaseListener, Mockito.times(0)).endSession();
122+
Mockito.verify(testCaseListener, Mockito.times(1)).endSession();
123123
Mockito.verify(testCaseListener, Mockito.times(0)).afterFuzz(Mockito.any());
124124
}
125125

0 commit comments

Comments
 (0)