diff options
author | Tomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com> | 2021-01-21 11:29:13 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2021-01-21 11:57:14 +0000 |
commit | 5c5d4e5aa06d7fd4618caf19279ce5a6efb26ce8 (patch) | |
tree | 7152495bbefbc45bacb852bb0718c9d0ef17a4c8 | |
parent | 7ccd053b8fba4adb564677feabfecfb0f446559e (diff) |
Fix critical bug in sonar in SecurityManagerTest.java
Change-Id: I2ea2a7c859ea01f86e66440816427f1d5355fa72
Issue-ID: SDC-3444
Signed-off-by: Tomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com>
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java index 0ed871d47c..306bc322dc 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java @@ -86,13 +86,14 @@ public class SecurityManagerTest { @Test public void testGetCertificatesException() throws IOException, SecurityManagerException { + File newFile = new File(cerDirPath + "root-certificate.pem"); + newFile.createNewFile(); Assertions.assertThrows(SecurityManagerException.class, () -> { - File newFile = new File(cerDirPath + "root-certificate.pem"); - newFile.createNewFile(); assertEquals(1, securityManager.getTrustedCertificates().size()); - newFile.delete(); - assertEquals(0, securityManager.getTrustedCertificates().size()); }); + newFile.delete(); + assertEquals(0, securityManager.getTrustedCertificates().size()); + } @Test |