Remove vulnerable dependency 87/126387/3
authorvasraz <vasyl.razinkov@est.tech>
Thu, 30 Dec 2021 13:59:00 +0000 (13:59 +0000)
committerMichael Morris <michael.morris@est.tech>
Wed, 5 Jan 2022 11:11:55 +0000 (11:11 +0000)
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Ic8283d37a0c4c5c4f4d30016525b819a56401c5e
Issue-ID: SDC-3820

integration-tests/pom.xml
integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/api/ComponentBaseTest.java
integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/rest/ResponseParser.java
integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/validation/AuditValidationUtils.java
integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/validation/ProductValidationUtils.java

index e5fede8..a5d7195 100644 (file)
@@ -320,12 +320,6 @@ limitations under the License.
             <version>3.3</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-api</artifactId>
-            <version>2.17.0</version>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
@@ -337,6 +331,12 @@ limitations under the License.
             <artifactId>epsdk-fw</artifactId>
             <version>${ecomp.version}</version>
             <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 
index 4bb7b61..9f481de 100644 (file)
@@ -33,8 +33,6 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.stream.Collectors;
 import org.apache.commons.collections.CollectionUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 import org.onap.sdc.backend.ci.tests.config.Config;
 import org.onap.sdc.backend.ci.tests.datatypes.ResourceReqDetails;
 import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
@@ -56,7 +54,8 @@ import org.openecomp.sdc.be.model.Product;
 import org.openecomp.sdc.be.model.Resource;
 import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.User;
-import org.slf4j.LoggerFactory;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.testng.ITestContext;
 import org.testng.ITestResult;
 import org.testng.annotations.AfterMethod;
@@ -66,7 +65,7 @@ import org.testng.annotations.BeforeSuite;
 
 public abstract class ComponentBaseTest {
 
-    protected static Logger logger = LogManager.getLogger(ComponentBaseTest.class);
+    protected static Logger logger = LoggerFactory.getLogger(ComponentBaseTest.class);
 
     protected static final String REPORT_FOLDER = "target" + File.separator + "ExtentReport" + File.separator + "API" + File.separator;
     private static final String REPORT_FILE_NAME = "SDC_CI_Extent_Report.html";
@@ -85,7 +84,7 @@ public abstract class ComponentBaseTest {
     }
 
     public ComponentBaseTest() {
-        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+        LoggerContext lc = (LoggerContext) org.slf4j.LoggerFactory.getILoggerFactory();
         lc.getLogger("com.thinkaurelius").setLevel(Level.INFO);
         lc.getLogger("com.datastax").setLevel(Level.INFO);
         lc.getLogger("io.netty").setLevel(Level.INFO);
index 437dc68..e8af0b1 100644 (file)
@@ -26,8 +26,8 @@ import com.fasterxml.jackson.databind.exc.InvalidFormatException;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 import com.google.gson.*;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.simple.JSONObject;
@@ -50,7 +50,6 @@ import java.io.InputStream;
 import java.text.ParseException;
 import java.util.*;
 
-
 public class ResponseParser {
 
     private static final String INVARIANT_UUID = "invariantUUID";
@@ -61,7 +60,7 @@ public class ResponseParser {
     public static final String ORIGIN_TYPE = "originType";
     public static final String TOSCA_RESOURCE_NAME = "toscaResourceName";
 
-    static Logger logger = LogManager.getLogger(ResponseParser.class);
+    static Logger logger = LoggerFactory.getLogger(ResponseParser.class);
 
     public static String getValueFromJsonResponse(String response, String fieldName) {
         try {
@@ -529,7 +528,7 @@ public class ResponseParser {
             interfaceDefinition = mapper.readValue(response, InterfaceDefinition.class);
             logger.debug(interfaceDefinition.toString());
         } catch (IOException e) {
-            logger.debug(e);
+            logger.debug("Failed to convertInterfaceDefinitionResponseToJavaObject", e);
         }
         return interfaceDefinition;
     }
index 762e8d9..152d256 100644 (file)
@@ -25,8 +25,8 @@ import com.datastax.driver.core.Row;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.*;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -63,13 +63,12 @@ import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
 
 public class AuditValidationUtils {
-       protected static Logger logger = LogManager.getLogger(AuditValidationUtils.class);
+       protected static Logger logger = LoggerFactory.getLogger(AuditValidationUtils.class);
        private static final String auditKeySpaceName = "sdcaudit";
 
        public AuditValidationUtils() {
                super();
-               logger = LogManager.getLogger(AuditValidationUtils.class);
-
+               logger = LoggerFactory.getLogger(AuditValidationUtils.class);
        }
 
        public static String buildAuditDescription(ErrorInfo errorInfo, List<String> errorVariablesList) {
index f6b6124..60343ee 100644 (file)
@@ -20,8 +20,8 @@
 
 package org.onap.sdc.backend.ci.tests.utils.validation;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 import org.json.simple.JSONValue;
@@ -44,7 +44,7 @@ import static org.testng.AssertJUnit.*;
 
 public class ProductValidationUtils {
 
-       static Logger logger = LogManager.getLogger(ProductValidationUtils.class);
+       static Logger logger = LoggerFactory.getLogger(ProductValidationUtils.class);
 
        public static void compareExpectedAndActualProducts(Product expectedProduct, Product actualProduct) {
                compareExpectedAndActualProducts(expectedProduct, actualProduct, null);