diff options
author | 2023-02-17 18:14:48 +0530 | |
---|---|---|
committer | 2023-02-17 18:43:55 +0530 | |
commit | 53ee6272b625c8984c792b9c6bb6e61416ed5ed6 (patch) | |
tree | 52ed6515eb38c5844ac957bf1b8b21d29ee1da99 /security/ssl/src | |
parent | 51ea34fd95de5ec9a0e7faad66709c426870ec14 (diff) |
[DCAEGEN2]Enhance dcaegen2-services-sdk's security module JUnits
Enhance services-sdk's security module junits to have OS agnostic path
Issue-ID: DCAEGEN2-3352
Change-Id: I7f4a1e027af48046f272b9383516a886216e5ffe
Signed-off-by: pranitk1905 <pranit.kapdule@t-systems.com>
[DCAEGEN2]Enhance dcaegen2-services-sdk's security module JUnits
Enhance services-sdk's security module junits to have OS agnostic path
Issue-ID: DCAEGEN2-3352
Change-Id: I7f4a1e027af48046f272b9383516a886216e5ffe
Signed-off-by: pranitk1905 <pranit.kapdule@t-systems.com>
Diffstat (limited to 'security/ssl/src')
2 files changed, 8 insertions, 4 deletions
diff --git a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/KeyStoreTypesTest.java b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/KeyStoreTypesTest.java index ab2aa773..6c9cd889 100644 --- a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/KeyStoreTypesTest.java +++ b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/KeyStoreTypesTest.java @@ -3,6 +3,7 @@ * DCAEGEN2-SERVICES-SDK * ========================================================= * Copyright (C) 2019 Nokia. All rights reserved. + * Copyright (c) 2023 Deutsche Telekom AG. All rights reserved. * ========================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +24,8 @@ package org.onap.dcaegen2.services.sdk.security.ssl; import static org.assertj.core.api.Assertions.assertThat; import io.vavr.control.Option; + +import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import org.junit.jupiter.api.Test; @@ -70,7 +73,7 @@ class KeyStoreTypesTest { } private Option<String> callGuessTypeWithFileName(String fileName) { - final Path path = Paths.get("/", "tmp", fileName); + final Path path = Paths.get(File.listRoots()[0].toString(), "tmp", fileName); return KeyStoreTypes.inferTypeFromExtension(path); } -}
\ No newline at end of file +} diff --git a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/PasswordsTest.java b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/PasswordsTest.java index 13d7f213..271f2d48 100644 --- a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/PasswordsTest.java +++ b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/PasswordsTest.java @@ -3,6 +3,7 @@ * DCAEGEN2-SERVICES-SDK * ========================================================= * Copyright (C) 2019 Nokia. All rights reserved. + * Copyright (c) 2023 Deutsche Telekom AG. All rights reserved. * ========================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,7 +103,7 @@ class PasswordsTest { @Test void fromPath_shouldFail_whenNotFound() { // given - final Path path = Paths.get("/", UUID.randomUUID().toString()); + final Path path = Paths.get(File.listRoots()[0].toString(), UUID.randomUUID().toString()); // when Assertions.assertThrows(ReadingPasswordFromFileException.class, () -> { @@ -126,4 +127,4 @@ class PasswordsTest { private String extractPassword(Password pass) { return pass.use(String::new); } -}
\ No newline at end of file +} |