aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/http/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/http/src/main/java')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java16
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java6
2 files changed, 11 insertions, 11 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
index d064547e..e7a643ad 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
@@ -68,8 +68,8 @@ public class OnapCommandSchemaHttpLoader {
errors.addAll(OnapCommandSchemaLoader.parseSchema(cmd, defaultParameterMap, validateSchema));
}
- Map<String, List<Map<String, String>>> commandYamlMap =
- (Map<String, List<Map<String, String>>>) OnapCommandSchemaLoader.validateSchemaVersion(schemaName, cmd.getSchemaVersion());
+ Map<String, ?> commandYamlMap =
+ OnapCommandSchemaLoader.validateSchemaVersion(schemaName, cmd.getSchemaVersion());
errors.addAll(parseHttpSchema(cmd, commandYamlMap, validateSchema));
@@ -162,20 +162,18 @@ public class OnapCommandSchemaHttpLoader {
Map<String, Object> context = (Map<String, Object>) map.get(key2);
for (String key: context.keySet()) {
- switch (key) {
- case OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES:
+ if (OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES.equals(key)) {
Boolean flag = Boolean.valueOf(context.get(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES).toString());
cmd.getInput().getContext().put(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES, flag.toString());
- break;
}
}
-
break;
case OnapCommandHttpConstants.MULTIPART_ENTITY_NAME:
Object multipartEntityName = map.get(key2);
cmd.getInput().setMultipartEntityName(multipartEntityName.toString());
break;
+ default : // Do nothing
}
}catch (Exception ex) {
OnapCommandUtils.throwOrCollect(new OnapCommandInvalidSchema(cmd.getSchemaName(), ex), errorList, validate);
@@ -235,6 +233,7 @@ public class OnapCommandSchemaHttpLoader {
Object mode = serviceMap.get(key);
srv.setMode(mode.toString());
break;
+ default : // Do nothing
}
}
@@ -260,6 +259,7 @@ public class OnapCommandSchemaHttpLoader {
case OnapCommandHttpConstants.SAMPLE_RESPONSE:
// (mrkanag) implement sample response handling
break;
+ default : // Do nothing
}
}
}
@@ -353,10 +353,8 @@ public class OnapCommandSchemaHttpLoader {
for (Object successCode : requestSuccessCodes) {
Integer code = Integer.valueOf(String.valueOf(successCode));
- if (code < 200 || code >= 300) {
- if ( code != 404) {
+ if ((code < 200 || code >= 300) && code != 404) {
errorList.add(OnapCommandHttpConstants.HTTP_SUCCESS_CODE_INVALID);
- }
}
}
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java b/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java
index ec2f572a..dcc3082d 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java
@@ -52,9 +52,11 @@ import net.minidev.json.JSONArray;
public class OnapCommandHttpUtils {
- static Logger LOG = LoggerFactory.getLogger(OnapCommandHttpUtils.class);
+ static Logger log = LoggerFactory.getLogger(OnapCommandHttpUtils.class);
private static Gson gson = new GsonBuilder().serializeNulls().create();
-
+ private OnapCommandHttpUtils() {
+ throw new IllegalStateException("Utility class");
+ }
/**
* Set argument to param value.
*