diff options
author | SravanKumarGunda <sravan.kumar1@huawei.com> | 2020-06-18 19:05:44 +0530 |
---|---|---|
committer | SravanKumarGunda <sravan.kumar1@huawei.com> | 2020-07-02 16:02:50 +0530 |
commit | c3391bef9e04c2ad38ed96bd28a5c43ab6d961de (patch) | |
tree | fbb3c017de9d5e016a7d9de88b0ea1193b9d6265 /main | |
parent | 022ee4b8daa1b852d72c1083658d1efb254f9dd5 (diff) |
Code Improvements-Sonar Issue Fixes
Signed-off-by: SravanKumarGunda <sravan.kumar1@huawei.com>
Issue-ID: CLI-270
Change-Id: Iba00ddc8c471bc5990d87ba3729af373e2bd6711
Diffstat (limited to 'main')
-rw-r--r-- | main/src/test/java/org/onap/cli/main/OnapCommandSampleTest.java | 24 |
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(); + } + } |