diff options
Diffstat (limited to 'datafile-app-server/src/test')
-rw-r--r-- | datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
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") // @@ -91,6 +105,19 @@ public class FileDataTest { } @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() // .serverAddress(SERVER_ADDRESS) // |