summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java b/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java
index 3ec63ae6..bf61d344 100644
--- a/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java
+++ b/main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java
@@ -19,6 +19,12 @@ package org.onap.cli.main;
import org.onap.cli.fw.cmd.OnapCommand;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cli.fw.input.OnapCommandParameter;
+import org.onap.cli.fw.registrar.OnapCommandRegistrar;
+import java.util.HashSet;
+import java.util.Set;
+import org.junit.Test;
+import org.onap.cli.fw.conf.OnapCommandConstants;
/**
* This command helps to test the Command functionalities.
@@ -32,4 +38,22 @@ public class OnapCommandSampleTest extends OnapCommand {
}
+ @Test
+ public void sampleTestVersion() throws OnapCommandException {
+
+ Set < OnapCommandParameter > parameters = new HashSet < > ();
+ OnapCommandParameter version = new OnapCommandParameter();
+ version.setName(OnapCommandConstants.DEFAULT_PARAMETER_VERSION);
+ version.setValue(true);
+ parameters.add(version);
+ OnapCommandParameter hlp = new OnapCommandParameter();
+ hlp.setName(OnapCommandConstants.DEFAULT_PARAMETER_HELP);
+ hlp.setValue(false);
+ parameters.add(hlp);
+
+ OnapCommand sample = OnapCommandRegistrar.getRegistrar().get("sample-test");
+ sample.setParameters(parameters);
+ sample.execute();
+ }
+
}