diff options
author | 2020-06-18 16:25:39 +0530 | |
---|---|---|
committer | 2020-07-09 13:06:31 +0530 | |
commit | 5f23e02caa5ab128a4c01866dec91eaea8dc7cee (patch) | |
tree | ca3c4f31dc56ce64aa9c0165b8cac4dab8e70b7c /main/src/test | |
parent | c3391bef9e04c2ad38ed96bd28a5c43ab6d961de (diff) |
Fixed sonarcloud issues
Issue-ID: CLI-270
Signed-off-by: jitendra007 <jitendra.sharma1@huawei.com>
Change-Id: Ibb52afb2fe8fe7c9be4299d1a1cb1e3d32ab0eca
Diffstat (limited to 'main/src/test')
-rw-r--r-- | main/src/test/java/org/onap/cli/main/OnapCliMainTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
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 0fb83287..c1e05093 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -30,7 +30,11 @@ import org.onap.cli.fw.error.OnapCommandException; import org.onap.cli.fw.error.OnapCommandHelpFailed; import org.onap.cli.fw.registrar.OnapCommandRegistrar; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.Arrays; import org.onap.cli.fw.error.OnapCommandInvalidSchema; import org.onap.cli.fw.utils.OnapCommandDiscoveryUtils; import static org.junit.Assert.assertFalse; @@ -222,4 +226,23 @@ public class OnapCliMainTest { Map<String,?> map = OnapCommandDiscoveryUtils.loadYaml("src/test/resources/open-cli-schema/sample-test-schema.yaml"); assertFalse(map.isEmpty()); } + @Test + public void testverifyCommand() throws OnapCommandException { + cli = new OnapCli(new String[] {"schema-validate","--verify" }); + new MockUp<OnapCommandRegistrar>(){ + @Mock + public List<Map<String, Object>> getTestSuite(String cmd, String product) throws OnapCommandException { + List<Map<String, Object>> list=new ArrayList<>(); + Map<String,Object>map=new HashMap<>(); + map.put("output","output"); + map.put("input", Arrays.asList(new String[]{"--verify"})); + map.put("sampleid","sample1"); + map.put("samplefileid","schema-validate-sample.yaml"); + map.put("moco","schema-validate-moco.json"); + list.add(map); + return list; + } + }; + cli.handleCommand(); + } } |