diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java index 53c2e1d0bc..6fae6f0e72 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java @@ -86,7 +86,13 @@ public class SecurityManager { } private SecurityManager() { - certificateDirectory = this.getcertDirectory(); + certificateDirectory = this.getcertDirectory(System.getenv("SDC_CERT_DIR")); + } + + + // Package level constructor use in tests to avoid power mock + SecurityManager(String sdcCertDir) { + certificateDirectory = this.getcertDirectory(sdcCertDir); } public static SecurityManager getInstance() { @@ -193,8 +199,8 @@ public class SecurityManager { } } - private File getcertDirectory() { - String certDirLocation = System.getenv("SDC_CERT_DIR"); + private File getcertDirectory(String sdcCertDir) { + String certDirLocation = sdcCertDir; if (certDirLocation == null) { certDirLocation = CERTIFICATE_DEFAULT_LOCATION; } |