diff options
Diffstat (limited to 'trustStoreMerger')
5 files changed, 9 insertions, 12 deletions
diff --git a/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/api/CertificateConstants.java b/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/api/CertificateConstants.java index 629397e4..3442621b 100644 --- a/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/api/CertificateConstants.java +++ b/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/api/CertificateConstants.java @@ -21,6 +21,8 @@ package org.onap.oom.certservice.postprocessor.api; public class CertificateConstants { + private CertificateConstants() { } + public static final String JKS_TYPE = "JKS"; public static final String PKCS12_TYPE = "PKCS12"; public static final String X_509_CERTIFICATE = "X.509"; diff --git a/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/merger/model/TruststoreFactory.java b/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/merger/model/TruststoreFactory.java index b6984f36..5167c301 100644 --- a/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/merger/model/TruststoreFactory.java +++ b/trustStoreMerger/src/main/java/org/onap/oom/certservice/postprocessor/merger/model/TruststoreFactory.java @@ -23,9 +23,6 @@ import static org.onap.oom.certservice.postprocessor.api.CertificateConstants.JK import static org.onap.oom.certservice.postprocessor.api.CertificateConstants.PKCS12_TYPE; import java.io.File; -import org.onap.oom.certservice.postprocessor.merger.exception.KeystoreInstanceException; -import org.onap.oom.certservice.postprocessor.merger.exception.LoadTruststoreException; -import org.onap.oom.certservice.postprocessor.merger.exception.PasswordReaderException; import org.onap.oom.certservice.postprocessor.common.ExtensionResolver; import org.onap.oom.certservice.postprocessor.merger.exception.TruststoreFileFactoryException; @@ -41,8 +38,7 @@ public class TruststoreFactory { private TruststoreFactory() { } - public static Truststore create(String truststoreFilePath, String truststorePasswordPath) - throws TruststoreFileFactoryException, PasswordReaderException, KeystoreInstanceException, LoadTruststoreException { + public static Truststore create(String truststoreFilePath, String truststorePasswordPath) { File truststoreFile = new File(truststoreFilePath); if (!ExtensionResolver.checkIfFileExists(truststoreFile)) { throw new TruststoreFileFactoryException(String.format(FILE_DOES_NOT_EXIST_MSG_TEMPLATE, truststoreFile)); @@ -50,8 +46,7 @@ public class TruststoreFactory { return createTypedTruststore(truststoreFile, truststorePasswordPath); } - private static Truststore createTypedTruststore(File truststoreFile, String truststorePasswordPath) - throws KeystoreInstanceException, PasswordReaderException, LoadTruststoreException, TruststoreFileFactoryException { + private static Truststore createTypedTruststore(File truststoreFile, String truststorePasswordPath) { String extension = ExtensionResolver.get(truststoreFile); switch (extension) { case JKS_EXTENSION: diff --git a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/AppExecutorTest.java b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/AppExecutorTest.java index 5c79f6e9..19833cb8 100644 --- a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/AppExecutorTest.java +++ b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/AppExecutorTest.java @@ -35,7 +35,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.onap.oom.certservice.postprocessor.merger.exception.AliasConflictException; @ExtendWith(MockitoExtension.class) -public class AppExecutorTest { +class AppExecutorTest { @Mock Runnable logic; diff --git a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/common/FileToolsTest.java b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/common/FileToolsTest.java index 56f76e17..7b3b28ae 100644 --- a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/common/FileToolsTest.java +++ b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/common/FileToolsTest.java @@ -28,7 +28,7 @@ import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -public class FileToolsTest { +class FileToolsTest { public static final String BAK_EXTENSION = ".bak"; @@ -43,7 +43,7 @@ public class FileToolsTest { //when new FileTools().createBackup(fileToBackup); //then - assertThat(fileToBackup.equals(new File(backupFilePath))); + assertThat(fileToBackup).hasSameBinaryContentAs(new File(backupFilePath)); } @Test @@ -54,7 +54,7 @@ public class FileToolsTest { //when new FileTools().copy(sourceFile, destinationFile); //then - assertThat(sourceFile.equals(destinationFile)); + assertThat(sourceFile).hasSameBinaryContentAs(destinationFile); } diff --git a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/merger/model/certificate/PemAliasGeneratorTest.java b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/merger/model/certificate/PemAliasGeneratorTest.java index bde23003..03989f6f 100644 --- a/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/merger/model/certificate/PemAliasGeneratorTest.java +++ b/trustStoreMerger/src/test/java/org/onap/oom/certservice/postprocessor/merger/model/certificate/PemAliasGeneratorTest.java @@ -37,7 +37,7 @@ class PemAliasGeneratorTest { //when String alias = pemAliasGenerator.getAlias(); //then - assertThat(alias.contains(PREFIX_ALIAS_NAME)).isTrue(); + assertThat(alias).contains(PREFIX_ALIAS_NAME); } @Test |