summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-09-18 16:13:43 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-09-18 16:13:43 +0530
commitc4eb2182d3d8639158ad9924d7e53cb4fc074208 (patch)
treec85cac18d58e527df4845c2b45460d9b3a49b362
parent0b6db3fd771ab6b4fbc75d178afc3a5fb421f934 (diff)
VTP: Fix the vnftest-run cli
Issue-ID: VNFSDK-305 Change-Id: I833114b975b4d44b1eab3b9c2fa34dc3fdb9971d Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java6
-rw-r--r--products/onap-casablanca/features/vnfsdk/src/main/resources/open-cli-schema/vnftest-run.yaml4
2 files changed, 7 insertions, 3 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
index 879e6289..862e328b 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
@@ -262,7 +262,11 @@ public class OnapCommandUtils {
} else if (OnapCommandParameterType.MAP.equals(param.getParameterType())) {
try {
String value = new ObjectMapper().writeValueAsString(params.get(paramName).getValue());
- result += line.substring(currentIdx, idxS - 1) + value;
+ if ((idxS == 0) && (currentIdx == 0)) {
+ result = value;
+ } else {
+ result += line.substring(currentIdx, idxS - 1) + value;
+ }
} catch (JsonProcessingException e) { // NOSONAR
//never occur as map is coverted to json string here
}
diff --git a/products/onap-casablanca/features/vnfsdk/src/main/resources/open-cli-schema/vnftest-run.yaml b/products/onap-casablanca/features/vnfsdk/src/main/resources/open-cli-schema/vnftest-run.yaml
index 1cf4586a..829bd6ab 100644
--- a/products/onap-casablanca/features/vnfsdk/src/main/resources/open-cli-schema/vnftest-run.yaml
+++ b/products/onap-casablanca/features/vnfsdk/src/main/resources/open-cli-schema/vnftest-run.yaml
@@ -47,8 +47,8 @@ http:
auth: none
mode: direct
request:
- uri: /onapapi/vnfsdk-marketplace/v1/PackageResource/vtp/tests/S{name}/run
- method: GET
+ uri: /onapapi/vnfsdk-marketplace/v1/PackageResource/vtp/tests/${name}/run
+ method: POST
body: ${param}
success_codes:
- 201