Skip to content

Commit 443c44c

Browse files
committed
Update unit test of openStream()
1 parent 7bb3598 commit 443c44c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/test/java/org/embulk/output/sftp/TestSftpFileOutputPlugin.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ public void testResolveWithoutRetry()
768768
}
769769

770770
@Test
771-
public void testOpenStreamWithRetry() throws FileSystemException
771+
public void testOpenStreamWithoutRetry() throws FileSystemException
772772
{
773773
SftpFileOutputPlugin.PluginTask task = defaultTask();
774774
SftpUtils utils = new SftpUtils(task);
@@ -778,9 +778,13 @@ public void testOpenStreamWithRetry() throws FileSystemException
778778
.doCallRealMethod()
779779
.when(mock).getContent();
780780

781-
OutputStream stream = utils.openStream(mock);
782-
assertNotNull(stream);
783-
Mockito.verify(mock, Mockito.times(2)).getContent();
781+
try {
782+
utils.openStream(mock);
783+
fail("Should not reach here");
784+
}
785+
catch (FileSystemException e) {
786+
Mockito.verify(mock, Mockito.times(1)).getContent();
787+
}
784788
}
785789

786790
@Test

0 commit comments

Comments
 (0)