src/test/java/org/embulk/output/sftp/TestSftpFileOutputPlugin.java in embulk-output-sftp-0.1.11 vs src/test/java/org/embulk/output/sftp/TestSftpFileOutputPlugin.java in embulk-output-sftp-0.2.0

- old
+ new

@@ -766,22 +766,26 @@ Mockito.verify(utils, Mockito.times(1)).getSftpFileUri(Mockito.eq(defaultPathPrefix)); } } @Test - public void testOpenStreamWithRetry() throws FileSystemException + public void testOpenStreamWithoutRetry() throws FileSystemException { SftpFileOutputPlugin.PluginTask task = defaultTask(); SftpUtils utils = new SftpUtils(task); FileObject mock = Mockito.spy(utils.resolve(defaultPathPrefix)); Mockito.doThrow(new FileSystemException("Fake FileSystemException")) .doCallRealMethod() .when(mock).getContent(); - OutputStream stream = utils.openStream(mock); - assertNotNull(stream); - Mockito.verify(mock, Mockito.times(2)).getContent(); + try { + utils.openStream(mock); + fail("Should not reach here"); + } + catch (FileSystemException e) { + Mockito.verify(mock, Mockito.times(1)).getContent(); + } } @Test public void testNewSftpFileExists() throws IOException {