diff options
Diffstat (limited to 'framework/src/test/java/org/onap')
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java b/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java index b3835cee..096c6ff3 100644 --- a/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java +++ b/framework/src/test/java/org/onap/cli/fw/utils/OnapCommandUtilsTest.java @@ -22,9 +22,14 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import mockit.Invocation; -import mockit.Mock; -import mockit.MockUp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.junit.FixMethodOrder; import org.junit.Ignore; @@ -50,21 +55,16 @@ import org.onap.cli.fw.error.OnapCommandParameterOptionConflict; import org.onap.cli.fw.error.OnapCommandSchemaNotFound; import org.onap.cli.fw.http.HttpInput; import org.onap.cli.fw.http.HttpResult; +import org.onap.cli.fw.info.OnapCommandInfo; import org.onap.cli.fw.input.OnapCommandParameter; import org.onap.cli.fw.input.ParameterType; import org.onap.cli.fw.output.OnapCommandResult; import org.onap.cli.fw.run.OnapCommandExecutor; import org.springframework.core.io.Resource; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import mockit.Invocation; +import mockit.Mock; +import mockit.MockUp; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class OnapCommandUtilsTest { @@ -434,6 +434,22 @@ public class OnapCommandUtilsTest { } + + @Test + public void test() throws OnapCommandException { + OnapCommandSampleInfo cmd = new OnapCommandSampleInfo(); + OnapCommandUtils.loadSchema(cmd, "sample-test-info.yaml", true, false); + OnapCommandInfo info = cmd.getInfo(); + assert info != null; + } + + @OnapCommandSchema(name = "sample-test-info", version = "cli-1.0", schema = "sample-test-info.yaml") + class OnapCommandSampleInfo extends OnapCommand { + @Override + protected void run() throws OnapCommandException { + } + } + @OnapCommandSchema(name = "sample-test", version = "cli-1.0", schema = "sample-test-schema.yaml") class OnapCommandSample extends OnapCommand { @Override |