summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-05-13 04:31:28 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-13 04:31:28 +0000
commitf897dea936b0cdb10f199a7274f08b7c4e1b506f (patch)
tree8236b5a8929e5e43dcb3b848adb6e65a3677efd2
parent03f800b0007857d220e8a27fd7da06d0a9324edc (diff)
parent734d238cfd53bc587179c28ac32456869069f99c (diff)
Merge "sonar bug fix- A "List<Integer>" cannot contain a "String""
-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/schema/OnapCommandSchemaHttpLoader.java3
2 files changed, 3 insertions, 2 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 2bf1eb16..53a2d042 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(String.valueOf(output.getStatus()))) {
+ if (!this.getSuccessStatusCodes().contains(output.getStatus())) {
throw new OnapCommandExecutionFailed(this.getName(), output.getBody(), output.getStatus());
}
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 a01516fb..df9c84fc 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
@@ -246,7 +246,8 @@ public class OnapCommandSchemaHttpLoader {
if (validate) {
validateHttpSccessCodes(errorList, (List<Object>) valMap.get(key1));
}
- cmd.setSuccessStatusCodes((ArrayList) valMap.get(key1));
+ List<String> list = (ArrayList) valMap.get(key1);
+ cmd.setSuccessStatusCodes(list.stream().map(s -> Integer.parseInt(s)).collect(Collectors.toList()));
break;
case OnapCommandHttpConstants.RESULT_MAP: