import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.oran.datafile.commons.FileServerData;
import org.oran.datafile.configuration.SftpConfig;
import org.oran.datafile.exceptions.DatafileTaskException;
import org.oran.datafile.exceptions.NonRetryableDatafileTaskException;
+import org.oran.datafile.model.FileServerData;
@ExtendWith(MockitoExtension.class)
-public class SftpClientTest {
+class SftpClientTest {
private static final String HOST = "127.0.0.1";
private static final int SFTP_PORT = 1021;
private ChannelSftp channelMock;
@Test
- public void openWithPort_success() throws Exception {
+ void openWithPort_success() throws Exception {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void openWithoutPort_success() throws Exception {
+ void openWithoutPort_success() throws Exception {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void open_throwsExceptionWithRetry() throws Exception {
+ void open_throwsExceptionWithRetry() throws Exception {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void openAuthFail_throwsExceptionWithoutRetry() throws Exception {
+ void openAuthFail_throwsExceptionWithoutRetry() throws Exception {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
@SuppressWarnings("resource")
@Test
- public void collectFile_success() throws DatafileTaskException, SftpException {
+ void collectFile_success() throws DatafileTaskException, SftpException {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void collectFile_throwsExceptionWithRetry() throws SftpException {
+ void collectFile_throwsExceptionWithRetry() throws SftpException {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void collectFileFileMissing_throwsExceptionWithoutRetry() throws SftpException {
+ void collectFileFileMissing_throwsExceptionWithoutRetry() throws SftpException {
FileServerData expectedFileServerData = FileServerData.builder() //
.serverAddress(HOST) //
.userId(USERNAME) //
}
@Test
- public void close_success() {
+ void close_success() {
SftpClient sftpClient = new SftpClient(null, createSampleSftpClientSettings());
sftpClient.session = sessionMock;