import org.oran.datafile.oauth2.SecurityContext;
import reactor.test.StepVerifier;
-public class FileCollectorTest {
+class FileCollectorTest {
final static String DATAFILE_TMPDIR = "/tmp/onap_datafile/";
private static final String PRODUCT_NAME = "NrRadio";
}
@Test
- public void whenFtpesFile_returnCorrectResponse() throws Exception {
+ void whenFtpesFile_returnCorrectResponse() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any());
}
@Test
- public void whenSftpFile_returnCorrectResponse() throws Exception {
+ void whenSftpFile_returnCorrectResponse() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(sftpClientMock).when(collectorUndetTest).createSftpClient(any());
}
@Test
- public void whenHttpFile_returnCorrectResponse() throws Exception {
+ void whenHttpFile_returnCorrectResponse() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(dfcHttpClientMock).when(collectorUndetTest).createHttpClient(any());
}
@Test
- public void whenHttpsFile_returnCorrectResponse() throws Exception {
+ void whenHttpsFile_returnCorrectResponse() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(dfcHttpsClientMock).when(collectorUndetTest).createHttpsClient(any());
}
@Test
- public void whenFtpesFileAlwaysFail_retryAndFail() throws Exception {
+ void whenFtpesFileAlwaysFail_retryAndFail() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any());
}
@Test
- public void whenFtpesFileAlwaysFail_failWithoutRetry() throws Exception {
+ void whenFtpesFileAlwaysFail_failWithoutRetry() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any());
}
@Test
- public void whenFtpesFileFailOnce_retryAndReturnCorrectResponse() throws Exception {
+ void whenFtpesFileFailOnce_retryAndReturnCorrectResponse() throws Exception {
FileCollector collectorUndetTest = spy(new FileCollector(securityContext, appConfigMock, counters));
doReturn(ftpesClientMock).when(collectorUndetTest).createFtpesClient(any());
doThrow(new DatafileTaskException("Unable to collect file.")).doNothing().when(ftpesClientMock)