diff options
author | Michael Lando <ml636r@att.com> | 2017-07-12 00:54:52 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-07-12 01:55:12 +0300 |
commit | dd60339b06d252fcb1382aa97ab3d65b37dad021 (patch) | |
tree | c1551ce67cd77ca810ad5f579eb3617af86be85f /openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src | |
parent | ab146a193c43e9be0e9efeac7bab2690a7ba2d33 (diff) |
[sdc] rebase update
Change-Id: I8f1fc7150975122dd9f3f4e653b9983064b399a6
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src')
-rw-r--r-- | openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java index 87c75fce62..5f0bc90845 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java @@ -25,7 +25,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; - import org.apache.commons.collections4.CollectionUtils; import org.everit.json.schema.EnumSchema; import org.everit.json.schema.Schema; @@ -33,6 +32,8 @@ import org.everit.json.schema.ValidationException; import org.everit.json.schema.loader.SchemaLoader; import org.json.JSONObject; import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; @@ -49,6 +50,7 @@ import java.util.stream.Collectors; * The type Json util. */ public class JsonUtil { + private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class); /** * Object 2 json string. @@ -163,13 +165,15 @@ public class JsonUtil { Set<Object> possibleValues = ((EnumSchema) exception.getViolatedSchema()).getPossibleValues(); return exception.getMessage().replaceFirst("enum value", possibleValues.size() == 1 ? String.format("value. %s is the only possible value for this field", - possibleValues.iterator().next()) + possibleValues.iterator().next()) : String.format("value. Possible values: %s", CommonMethods .collectionToCommaSeparatedString( possibleValues.stream().map(Object::toString).collect(Collectors.toList())))); } private static List<ValidationException> validateUsingEverit(String json, String jsonSchema) { + logger.debug( + String.format("validateUsingEverit start, json=%s, jsonSchema=%s", json, jsonSchema)); if (json == null || jsonSchema == null) { throw new IllegalArgumentException("Input strings json and jsonSchema can not be null"); } |