aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be
diff options
context:
space:
mode:
authorTomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com>2021-01-21 11:29:13 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2021-01-21 11:57:14 +0000
commit5c5d4e5aa06d7fd4618caf19279ce5a6efb26ce8 (patch)
tree7152495bbefbc45bacb852bb0718c9d0ef17a4c8 /openecomp-be
parent7ccd053b8fba4adb564677feabfecfb0f446559e (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>
Diffstat (limited to 'openecomp-be')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManagerTest.java9
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