From 1577328de998d9b921e61ac9940a016ac1bbcecd Mon Sep 17 00:00:00 2001 From: Abhai Singh Date: Thu, 28 Dec 2017 19:13:06 +0530 Subject: Fix Sonar violations - ValidationTestUtil Fixed few reported sonar issues. One sonar issue related to exception handling is ignored as it would be fixed later Change-Id: I316868b2f6634e8858696e87604e73de7c8d5e40 Issue-ID: SDC-343 Signed-off-by: Abhai Singh --- .../org/openecomp/sdc/validation/util/ValidationTestUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src') diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java index 08a3548a7d..068e147874 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java @@ -26,7 +26,6 @@ import org.testng.Assert; import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.io.StringWriter; import java.net.URL; import java.util.Collection; import java.util.HashMap; @@ -38,9 +37,11 @@ import java.util.Objects; */ public class ValidationTestUtil { - private final static Logger log = (Logger) LoggerFactory.getLogger(ValidationTestUtil.class + private static final Logger LOG = LoggerFactory.getLogger(ValidationTestUtil.class .getName()); + private ValidationTestUtil(){} + public static GlobalValidationContext createGlobalContextFromPath(String path) { GlobalValidationContext globalValidationContext = new GlobalValidationContext(); Map contentMap = getContentMapByPath(path); @@ -181,7 +182,7 @@ public class ValidationTestUtil { CommonMethods.newInstance(validatorConf.getImplementationClass(), Validator.class); validator.init(validatorConf.getProperties()); } catch (IllegalArgumentException iae) { - log.debug("",iae); + LOG.debug("",iae); return null; } return validator; @@ -189,7 +190,6 @@ public class ValidationTestUtil { public static Map getResourceMap(String configFileName) throws IOException { URL mockResource = ValidationTestUtil.class.getResource(configFileName); - StringWriter writer = new StringWriter(); String json = IOUtils.toString(mockResource.openStream(), "UTF-8"); return JsonUtil.json2Object(json, Map.class); } -- cgit 1.2.3-korg