diff options
author | ecaiyanlinux <martin.c.yan@est.tech> | 2019-09-06 15:24:59 +0000 |
---|---|---|
committer | ecaiyanlinux <martin.c.yan@est.tech> | 2019-09-06 15:24:59 +0000 |
commit | 6c925362213b8f05612b309fb50fa4c0b5650224 (patch) | |
tree | 50b91263d7d457721627b87e7ac6e8f9a81c740d /datafile-app-server/src/test | |
parent | e92d9f47629e635ae70c856615556476d266cb3f (diff) |
TLS init container usage
Change-Id: Iec51c722f6a3a519fd7eb0f37f8b801eebbc039b
Issue-ID: DCAEGEN2-1702
Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Diffstat (limited to 'datafile-app-server/src/test')
8 files changed, 19 insertions, 17 deletions
diff --git a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java index c20dc2f3..d0f02d69 100644 --- a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java +++ b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfigTest.java @@ -121,10 +121,10 @@ public class AppConfigTest { private static final ImmutableFtpesConfig CORRECT_FTPES_CONFIGURATION = // new ImmutableFtpesConfig.Builder() // - .keyCert("/config/dfc.jks") // - .keyPassword("secret") // - .trustedCa("config/ftp.jks") // - .trustedCaPassword("secret") // + .keyCert("/src/test/resources/dfc.jks") // + .keyPasswordPath("/src/test/resources/dfc.jks.pass") // + .trustedCa("/src/test/resources/ftp.jks") // + .trustedCaPasswordPath("/src/test/resources/ftp.jks.pass") // .build(); private static final ImmutableDmaapPublisherConfiguration CORRECT_DMAAP_PUBLISHER_CONFIG = // @@ -270,7 +270,7 @@ public class AppConfigTest { } @Test - public void whenPeriodicConfigRefreshNoConsul() { + public void whenPeriodicConfigRefreshNoConsul() { EnvProperties props = properties(); doReturn(Mono.just(props)).when(appConfigUnderTest).getEnvironment(any(), any()); diff --git a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/tasks/FileCollectorTest.java b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/tasks/FileCollectorTest.java index 2534f645..e5523251 100644 --- a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/tasks/FileCollectorTest.java +++ b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/tasks/FileCollectorTest.java @@ -83,9 +83,9 @@ public class FileCollectorTest { private static final String FILE_FORMAT_VERSION = "V10"; private static final String FTP_KEY_PATH = "ftpKeyPath"; - private static final String FTP_KEY_PASSWORD = "ftpKeyPassword"; + private static final String FTP_KEY_PASSWORD_PATH = "ftpKeyPassword"; private static final String TRUSTED_CA_PATH = "trustedCAPath"; - private static final String TRUSTED_CA_PASSWORD = "trustedCAPassword"; + private static final String TRUSTED_CA_PASSWORD_PATH = "trustedCAPassword"; private static final String CHANGE_IDENTIFIER = "PM_MEAS_FILES"; private static AppConfig appConfigMock = mock(AppConfig.class); @@ -146,9 +146,9 @@ public class FileCollectorTest { static void setUpConfiguration() { when(appConfigMock.getFtpesConfiguration()).thenReturn(ftpesConfigMock); when(ftpesConfigMock.keyCert()).thenReturn(FTP_KEY_PATH); - when(ftpesConfigMock.keyPassword()).thenReturn(FTP_KEY_PASSWORD); + when(ftpesConfigMock.keyPasswordPath()).thenReturn(FTP_KEY_PASSWORD_PATH); when(ftpesConfigMock.trustedCa()).thenReturn(TRUSTED_CA_PATH); - when(ftpesConfigMock.trustedCaPassword()).thenReturn(TRUSTED_CA_PASSWORD); + when(ftpesConfigMock.trustedCaPasswordPath()).thenReturn(TRUSTED_CA_PASSWORD_PATH); } @BeforeEach diff --git a/datafile-app-server/src/test/resources/datafile_endpoints_test.json b/datafile-app-server/src/test/resources/datafile_endpoints_test.json index 8913dc48..58f4eb89 100644 --- a/datafile-app-server/src/test/resources/datafile_endpoints_test.json +++ b/datafile-app-server/src/test/resources/datafile_endpoints_test.json @@ -1,10 +1,10 @@ { "config": { "//description": "This file is only used for testing purposes", - "dmaap.ftpesConfig.keyCert": "/config/dfc.jks", - "dmaap.ftpesConfig.keyPassword": "secret", - "dmaap.ftpesConfig.trustedCa": "config/ftp.jks", - "dmaap.ftpesConfig.trustedCaPassword": "secret", + "dmaap.ftpesConfig.keyCert": "/src/test/resources/dfc.jks", + "dmaap.ftpesConfig.keyPasswordPath": "/src/test/resources/dfc.jks.pass", + "dmaap.ftpesConfig.trustedCa": "/src/test/resources/ftp.jks", + "dmaap.ftpesConfig.trustedCaPasswordPath": "/src/test/resources/ftp.jks.pass", "dmaap.security.trustStorePath": "trustStorePath", "dmaap.security.trustStorePasswordPath": "trustStorePasswordPath", "dmaap.security.keyStorePath": "keyStorePath", diff --git a/datafile-app-server/src/test/resources/datafile_endpoints_test_2producers.json b/datafile-app-server/src/test/resources/datafile_endpoints_test_2producers.json index 61b324ce..40c28dde 100644 --- a/datafile-app-server/src/test/resources/datafile_endpoints_test_2producers.json +++ b/datafile-app-server/src/test/resources/datafile_endpoints_test_2producers.json @@ -1,10 +1,10 @@ { "config": { "//description": "This file is only used for testing purposes", - "dmaap.ftpesConfig.keyCert": "/config/dfc.jks", - "dmaap.ftpesConfig.keyPassword": "secret", - "dmaap.ftpesConfig.trustedCa": "config/ftp.jks", - "dmaap.ftpesConfig.trustedCaPassword": "secret", + "dmaap.ftpesConfig.keyCert": "/src/test/resources/dfc.jks", + "dmaap.ftpesConfig.keyPasswordPath": "/src/test/resources/dfc.jks.pass", + "dmaap.ftpesConfig.trustedCa": "/src/test/resources/ftp.jks", + "dmaap.ftpesConfig.trustedCaPasswordPath": "/src/test/resources/ftp.jks.pass", "dmaap.security.trustStorePath": "trustStorePath", "dmaap.security.trustStorePasswordPath": "trustStorePasswordPath", "dmaap.security.keyStorePath": "keyStorePath", diff --git a/datafile-app-server/src/test/resources/dfc.jks b/datafile-app-server/src/test/resources/dfc.jks Binary files differnew file mode 100644 index 00000000..cdd1191b --- /dev/null +++ b/datafile-app-server/src/test/resources/dfc.jks diff --git a/datafile-app-server/src/test/resources/dfc.jks.pass b/datafile-app-server/src/test/resources/dfc.jks.pass new file mode 100644 index 00000000..d97c5ead --- /dev/null +++ b/datafile-app-server/src/test/resources/dfc.jks.pass @@ -0,0 +1 @@ +secret diff --git a/datafile-app-server/src/test/resources/ftp.jks b/datafile-app-server/src/test/resources/ftp.jks Binary files differnew file mode 100644 index 00000000..427ea231 --- /dev/null +++ b/datafile-app-server/src/test/resources/ftp.jks diff --git a/datafile-app-server/src/test/resources/ftp.jks.pass b/datafile-app-server/src/test/resources/ftp.jks.pass new file mode 100644 index 00000000..d97c5ead --- /dev/null +++ b/datafile-app-server/src/test/resources/ftp.jks.pass @@ -0,0 +1 @@ +secret |