From 5c5d4e5aa06d7fd4618caf19279ce5a6efb26ce8 Mon Sep 17 00:00:00 2001 From: Tomasz Pietruszkiewicz Date: Thu, 21 Jan 2021 11:29:13 +0100 Subject: Fix critical bug in sonar in SecurityManagerTest.java Change-Id: I2ea2a7c859ea01f86e66440816427f1d5355fa72 Issue-ID: SDC-3444 Signed-off-by: Tomasz Pietruszkiewicz --- .../sdc/vendorsoftwareproduct/security/SecurityManagerTest.java | 9 +++++---- 1 file 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 -- cgit 1.2.3-korg