aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/http/src
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-12 11:18:27 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-05-12 11:18:27 +0000
commit734d238cfd53bc587179c28ac32456869069f99c (patch)
tree0d5ab7232a5a168491f52d965624a31a2ecd83fb /profiles/http/src
parentb8935cd526d698118d3b3c5324075626dbeb5c70 (diff)
sonar bug fix- A "List<Integer>" cannot contain a "String"
Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Issue-ID: CLI-270 Change-Id: I4ada3a4a5168c0686b7595c8038dc1fb300c14fb
Diffstat (limited to 'profiles/http/src')
-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: