aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-03-13 10:43:36 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-03-13 10:44:57 +0000
commit8c08476d0b6bffa3230a0e34ff29586eefed38e0 (patch)
tree50df9a90f3cbbe4ea6824e1a95b774e0f2d0465c /main/src
parenta59f5607eaf196e032990b3ca962f2378e45fa52 (diff)
Enable feature to disable mock for verify
Enable feature to disable mock for verify so that real environment can be used. Issue-ID: CLI-74 Change-Id: Ibaa15b7c93fcf077e3f28e9f7e96b1b8a68ad5c0 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java
index e70c7186..7f70e1c7 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -219,6 +219,13 @@ public class OnapCli {
}
public void verifyCommand(OnapCommand cmd) throws OnapCommandException {
+
+ OnapCliArgsParser.populateParams(cmd.getParameters(), args);
+
+ Optional<OnapCommandParameter> contextOptArg = cmd.getParameters().stream()
+ .filter(e -> e.getName().equals(OnapCommandConstants.VERIFY_CONTEXT_PARAM))
+ .findFirst();
+
List<Map<String, ?>> testSuite = OnapCommandRegistrar.getRegistrar().getTestSuite(cmd.getName());
OnapCommandResult testSuiteResult = new OnapCommandResult();
@@ -254,6 +261,12 @@ public class OnapCli {
if (contextOpt.isPresent()) {
HashMap map = new HashMap();
map.put(OnapCommandConstants.VERIFY_MOCO, sampleTest.get(OnapCommandConstants.VERIFY_MOCO));
+
+ if (contextOptArg.isPresent()) {
+ OnapCommandParameter contextArg = contextOptArg.get();
+ map.putAll((Map) contextArg.getValue());
+ }
+
contextOpt.get().setValue(map);
}