From dfeb8e23c04bc94050f95c95458605fb4c3cb6d5 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Mon, 18 Sep 2017 11:38:10 +0530 Subject: Improve the UT of profile CLI-43 Change-Id: If2f1040a93d18d8f4375c459db3e7250f4dba99f Signed-off-by: Kanagaraj Manickam k00365106 --- .../test/java/org/onap/cli/main/OnapCliMainTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'main/src/test/java/org') diff --git a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java index 0a84d268..f052cbd1 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -128,6 +128,25 @@ public class OnapCliMainTest { this.handle(new String[] { "sample-test", "-h" }); } + @Test + public void testVersionSampleCommandShort() { + this.handle(new String[] { "sample-test", "-v" }); + } + + @Test + public void testHandleSampleCommandSet() throws OnapCommandException { + OnapCommandRegistrar.getRegistrar().addParamCache("sample:string-param", "paramValue"); + OnapCommandRegistrar.getRegistrar().addParamCache("onap-username", "paramValue"); + OnapCommandRegistrar.getRegistrar().addParamCache("onap-password", "paramValue"); + OnapCommandRegistrar.getRegistrar().addParamCache("host-url", "paramValue"); + this.handle(new String[] { "sample-test", "--string-param", "test"}); + } + + @Test + public void testHandleSampleCommandFailure() throws OnapCommandException { + this.handle(new String[] { "sample-test", "--string-param"}); + } + @Test public void interactiveTest() { cli = new OnapCli(new String[] {}); -- cgit 1.2.3-korg