From f15306304a747922990eeabbedea63ae6e277149 Mon Sep 17 00:00:00 2001 From: burdziak Date: Mon, 16 Sep 2019 12:56:44 +0200 Subject: Personalized client certificate authentication via FTPes in 5G Bulk PM usecase doesn't work Issue-ID: DCAEGEN2-1754 Signed-off-by: burdziak Change-Id: Idec3efce8412dd175ecf75f55790a24cec651104 --- .../collectors/datafile/model/FileDataTest.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'datafile-app-server/src/test/java') diff --git a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java index 35894f9c..10a84e76 100644 --- a/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java +++ b/datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java @@ -37,6 +37,8 @@ public class FileDataTest { private static final int PORT_22 = 22; private static final String LOCATION_WITH_USER = FTPES_SCHEME + USER + ":" + PWD + "@" + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION; + private static final String LOCATION_WITH_USER_NO_PASSWORD = + FTPES_SCHEME + USER + "@" + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION; private static final String LOCATION_WITHOUT_USER = FTPES_SCHEME + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION; @@ -65,6 +67,18 @@ public class FileDataTest { .build(); } + private FileData properFileDataWithUserNoPassword() { + return ImmutableFileData.builder() // + .name("name") // + .location(LOCATION_WITH_USER_NO_PASSWORD) // + .compression("comp") // + .fileFormatType("type") // + .fileFormatVersion("version") // + .scheme(Scheme.FTPS) // + .messageMetaData(messageMetaData()) // + .build(); + } + private FileData properFileDataWithoutUser() { return ImmutableFileData.builder() // .name("name") // @@ -90,6 +104,19 @@ public class FileDataTest { assertEquals(expectedFileServerData, actualFileServerData); } + @Test + public void fileServerData_properLocationWithUserNoPassword() { + ImmutableFileServerData expectedFileServerData = ImmutableFileServerData.builder() // + .serverAddress(SERVER_ADDRESS) // + .port(PORT_22) // + .userId(USER) // + .password("") // + .build(); + + FileServerData actualFileServerData = properFileDataWithUserNoPassword().fileServerData(); + assertEquals(expectedFileServerData, actualFileServerData); + } + @Test public void fileServerData_properLocationWithoutUser() { ImmutableFileServerData expectedFileServerData = ImmutableFileServerData.builder() // -- cgit 1.2.3-korg