aboutsummaryrefslogtreecommitdiffstats
path: root/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'profiles')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java2
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/mock/MocoServer.java9
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java4
3 files changed, 8 insertions, 7 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java b/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java
index 53a2d042..2bf1eb16 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java
@@ -242,7 +242,7 @@ public class OnapHttpCommand extends OnapCommand {
this.output = this.authClient.run(this.getInput());
this.getResult().setOutput(output);
- if (!this.getSuccessStatusCodes().contains(output.getStatus())) {
+ if (!this.getSuccessStatusCodes().contains(String.valueOf(output.getStatus()))) {
throw new OnapCommandExecutionFailed(this.getName(), output.getBody(), output.getStatus());
}
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/mock/MocoServer.java b/profiles/http/src/main/java/org/onap/cli/fw/http/mock/MocoServer.java
index 25cf14a3..a2e025a8 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/mock/MocoServer.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/mock/MocoServer.java
@@ -30,7 +30,7 @@ import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.http.conf.OnapCommandHttpConstants;
import org.onap.cli.fw.utils.OnapCommandDiscoveryUtils;
import org.springframework.core.io.Resource;
-import org.yaml.snakeyaml.Yaml;
+import com.esotericsoftware.yamlbeans.YamlReader;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -38,6 +38,7 @@ import com.github.dreamhead.moco.HttpServer;
import com.github.dreamhead.moco.Moco;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.Runner;
+import java.io.InputStreamReader;
public class MocoServer {
@@ -56,8 +57,8 @@ public class MocoServer {
}
List<Map<String, ?>> stringMap = null;
- try {
- stringMap = (List<Map<String, ?>>) new Yaml().load(resource.getInputStream());
+ try(InputStreamReader inputStreamReader = new InputStreamReader(resource.getInputStream());) {
+ stringMap = (List<Map<String, ?>>) new YamlReader(inputStreamReader).read();
} catch (IOException e) {
throw new OnapCommandException("Invalid mocking file" + mockFile, e);
}
@@ -89,7 +90,7 @@ public class MocoServer {
if (mocoServerConfigs.containsKey(OnapCommandHttpConstants.VERIFY_RESPONSE_JSON)) {
responseHandlers.add(Moco.with(mocoServerConfigs.get(OnapCommandHttpConstants.VERIFY_RESPONSE_JSON).toString()));
}
- responseHandlers.add(Moco.status((Integer) mocoServerConfigs.get(OnapCommandHttpConstants.VERIFY_RESPONSE_STATUS)));
+ responseHandlers.add(Moco.status(Integer.parseInt(String.valueOf(mocoServerConfigs.get(OnapCommandHttpConstants.VERIFY_RESPONSE_STATUS)))));
server.request(Moco.by(Moco.uri((String) mocoServerConfigs.get(OnapCommandHttpConstants.VERIFY_REQUEST_URI))))
.response(Moco.header(OnapCommandHttpConstants.VERIFY_CONTENT_TYPE, OnapCommandHttpConstants.VERIFY_CONTENT_TYPE_VALUE),
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 c07a6f7f..a01516fb 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
@@ -164,7 +164,7 @@ public class OnapCommandSchemaHttpLoader {
for (String key: context.keySet()) {
switch (key) {
case OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES:
- Boolean flag = (Boolean) context.get(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES);
+ 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;
}
@@ -351,7 +351,7 @@ public class OnapCommandSchemaHttpLoader {
}
for (Object successCode : requestSuccessCodes) {
- Integer code = (Integer) successCode;
+ Integer code = Integer.valueOf(String.valueOf(successCode));
if (code < 200 || code >= 300) {
if ( code != 404) {
errorList.add(OnapCommandHttpConstants.HTTP_SUCCESS_CODE_INVALID);