diff options
Diffstat (limited to 'framework/src/test')
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java | 19 | ||||
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/cmd/OnapSwaggerCommandTest.java | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java b/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java index 77ef680d..e6054127 100644 --- a/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java +++ b/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java @@ -21,18 +21,17 @@ import static org.junit.Assert.fail; import org.junit.Test; import org.onap.cli.fw.OnapCommand; import org.onap.cli.fw.OnapCommandRegistrar; +import org.onap.cli.fw.cmd.OnapHttpCommand; import org.onap.cli.fw.conf.Constants; import org.onap.cli.fw.conf.OnapCommandConfg; import org.onap.cli.fw.error.OnapCommandException; public class OnapAuthClientCommandBasedTest { - OnapCommand cmd; - @Test public void internalCommandTest() { try { - cmd = OnapCommandRegistrar.getRegistrar().get("sample-test"); + OnapCommand cmd = OnapCommandRegistrar.getRegistrar().get("sample-test"); cmd.getService().setName(OnapCommandConfg.getInternalCmd()); cmd.execute(); @@ -45,7 +44,7 @@ public class OnapAuthClientCommandBasedTest { @Test public void yesCatalogYesAuthTest() throws OnapCommandException { try { - cmd = getCommand("sample-test-schema-yes-auth-yes-catalog.yaml"); + OnapHttpCommand cmd = getCommand("sample-test-schema-yes-auth-yes-catalog.yaml"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_HOST_URL).setValue("http://localhost:8080"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_USERNAME).setValue("test"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_PASS_WORD).setValue("password"); @@ -60,7 +59,7 @@ public class OnapAuthClientCommandBasedTest { @Test public void yesCatalogNoAuthTest() throws OnapCommandException { try { - cmd = getCommand("sample-test-schema-no-auth-yes-catalog.yaml"); + OnapHttpCommand cmd = getCommand("sample-test-schema-no-auth-yes-catalog.yaml"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_HOST_URL).setValue("http://localhost:8080"); cmd.execute(); @@ -73,7 +72,7 @@ public class OnapAuthClientCommandBasedTest { @Test public void noCatalogYesAuthTest() throws OnapCommandException { try { - cmd = getCommand("sample-test-schema-yes-auth-no-catalog.yaml"); + OnapHttpCommand cmd = getCommand("sample-test-schema-yes-auth-no-catalog.yaml"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_HOST_URL).setValue("http://localhost:8080"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_USERNAME).setValue("test"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_PASS_WORD).setValue("password"); @@ -88,7 +87,7 @@ public class OnapAuthClientCommandBasedTest { @Test public void noCatalogNoAuthTest() throws OnapCommandException { try { - cmd = getCommand("sample-test-schema-no-auth-no-catalog.yaml"); + OnapHttpCommand cmd = getCommand("sample-test-schema-no-auth-no-catalog.yaml"); cmd.getParametersMap().get(Constants.DEAFULT_PARAMETER_HOST_URL).setValue("http://localhost:8080"); cmd.execute(); @@ -98,10 +97,10 @@ public class OnapAuthClientCommandBasedTest { } } - private OnapCommand getCommand(String yaml) throws OnapCommandException { - OnapCommand cmd = new OnapCommand() { + private OnapHttpCommand getCommand(String yaml) throws OnapCommandException { + OnapHttpCommand cmd = new OnapHttpCommand() { @Override - protected void run() throws OnapCommandException { + protected void processRequest() throws OnapCommandException { if (!this.getService().isModeDirect()) { String url = this.authClient.getServiceUrl(); assert url.equals(this.getParametersMap().get(Constants.DEAFULT_PARAMETER_HOST_URL).getValue() + "/"); diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSwaggerCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSwaggerCommandTest.java index 628b9a42..47e3e050 100644 --- a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSwaggerCommandTest.java +++ b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSwaggerCommandTest.java @@ -55,7 +55,7 @@ public class OnapSwaggerCommandTest { swagger.initializeResult(obj1); } - @Test(expected = NullPointerException.class) + @Test public void initializeResultTest3() throws OnapCommandException { OnapSwaggerCommandImpl swagger = new OnapSwaggerCommandImpl(); swagger.initializeSchema("onap-test-schema.yaml"); |