aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog.md2
-rw-r--r--security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/SslFactoryTest.java23
2 files changed, 24 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 81ad1232..3d6c993a 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.9.1] - 2022/09/07
### Added
- [DCAEGEN2-3165] (https://jira.onap.org/browse/DCAEGEN2-3165) - Fix calculation of code coverage
- - [DCAEGEN2-3165] (https://jira.onap.org/browse/DCAEGEN2-3165) - increase code coverage
+ - [DCAEGEN2-3165] (https://jira.onap.org/browse/DCAEGEN2-3165) - increase code coverage
## [1.9.0] - 2022/09/07
### Added
diff --git a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/SslFactoryTest.java b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/SslFactoryTest.java
index 088c7219..e3605e21 100644
--- a/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/SslFactoryTest.java
+++ b/security/ssl/src/test/java/org/onap/dcaegen2/services/sdk/security/ssl/SslFactoryTest.java
@@ -28,6 +28,7 @@ import java.net.URISyntaxException;
import java.nio.file.Paths;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.onap.dcaegen2.services.sdk.security.ssl.Passwords.fromResource;
@@ -88,8 +89,30 @@ class SslFactoryTest {
.hasMessageContaining("Keystore was tampered with, or password was incorrect");
}
+ @Test
+ void testCreateInsecureClient () {
+ assertThatCode(() -> sut.createInsecureClientContext())
+ .doesNotThrowAnyException();
+ }
+
+ @Test
+ void testCreateSecureClientContextFromSecurityKeys() throws Exception {
+ // given
+ final SecurityKeys securityKeys = ImmutableSecurityKeys.builder()
+ .keyStore(keyStoreFromResource("/sample/cert.jks"))
+ .keyStorePassword(fromResource("/sample/jks.pass"))
+ .trustStore(keyStoreFromResource("/sample/trust.jks"))
+ .trustStorePassword(fromResource("/sample/trust.pass"))
+ .build();
+
+ // when
+ assertThatCode(() -> sut.createSecureClientContext(securityKeys))
+ .doesNotThrowAnyException();
+ }
+
private @NotNull SecurityKeysStore keyStoreFromResource(String resource) throws URISyntaxException {
return SecurityKeysStore.fromPath(
Paths.get(Passwords.class.getResource(resource).toURI()));
}
+
}