diff options
author | Rodrigo Lima <rodrigo.lima@yoppworks.com> | 2020-05-11 15:54:37 -0400 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-05-12 06:21:23 +0000 |
commit | f2b6c943b558fcc5161b30ac30c1010066a135ae (patch) | |
tree | f84c3a18a7a123e68b65088ae78d714435617a29 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main | |
parent | 052b66bed19c2ee0b7ef6c992ee709a1db90a73e (diff) |
Remove powermock from SecurityManagerTest
- Add new package level constructor to SecurityManager
- Remove powermock from SecurityManagerTest
Issue-ID: SDC-3054
Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com>
Change-Id: I04c53601f31d2aad84de8f8801f6889f8b9d4260
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main')
-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; } |