summaryrefslogtreecommitdiffstats
path: root/framework/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/test')
-rw-r--r--framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientCommandBasedTest.java12
-rw-r--r--framework/src/test/resources/open-cli-schema/testauth-login.yaml28
-rw-r--r--framework/src/test/resources/open-cli-schema/testauth-logout.yaml19
-rw-r--r--framework/src/test/resources/sample-test-schema-yes-auth-with-additional-params-no-catalog.yaml28
4 files changed, 87 insertions, 0 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 9c733c94..58b44f4a 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
@@ -16,6 +16,7 @@
package org.onap.cli.fw.ad;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Before;
@@ -92,6 +93,17 @@ public class OnapAuthClientCommandBasedTest {
}
@Test
+ public void noCatalogYesAuthWithAdditionalParamsTest() throws OnapCommandException {
+ try {
+ OnapHttpCommand cmd = getCommand("sample-test-schema-yes-auth-with-additional-params-no-catalog.yaml");
+ assertTrue(cmd.getParametersMap().containsKey("string-param"));
+ } catch (OnapCommandException e) {
+ fail("External command Yes Auth No Catalog failed to run");
+ e.printStackTrace(System.out);
+ }
+ }
+
+ @Test
public void noCatalogNoAuthTest() throws OnapCommandException {
try {
OnapHttpCommand cmd = getCommand("sample-test-schema-no-auth-no-catalog.yaml");
diff --git a/framework/src/test/resources/open-cli-schema/testauth-login.yaml b/framework/src/test/resources/open-cli-schema/testauth-login.yaml
new file mode 100644
index 00000000..8f3a8339
--- /dev/null
+++ b/framework/src/test/resources/open-cli-schema/testauth-login.yaml
@@ -0,0 +1,28 @@
+open_cli_schema_version: 1.0
+
+name: testauth-login
+
+description: basic login auth command
+
+info:
+ product: open-cli
+ service: test
+ type: auth
+ author: Kanagaraj Manickam mkr1481@gmail.com
+
+parameters:
+ - name: string-param
+ type: string
+ description: Oclip string param
+ long_option: string-param
+ short_option: c
+ is_optional: false
+ default_Value: test
+
+# followings are dummy simulator for http command
+http:
+ request:
+ uri: /
+ method: GET
+ success_codes:
+ - 200
diff --git a/framework/src/test/resources/open-cli-schema/testauth-logout.yaml b/framework/src/test/resources/open-cli-schema/testauth-logout.yaml
new file mode 100644
index 00000000..d8de7c6f
--- /dev/null
+++ b/framework/src/test/resources/open-cli-schema/testauth-logout.yaml
@@ -0,0 +1,19 @@
+open_cli_schema_version: 1.0
+
+name: testauth-logout
+
+description: basic logout auth command
+
+info:
+ product: open-cli
+ service: test
+ type: auth
+ author: Kanagaraj Manickam mkr1481@gmail.com
+
+# followings are dummy simulator for http command
+http:
+ request:
+ uri: /
+ method: GET
+ success_codes:
+ - 200 \ No newline at end of file
diff --git a/framework/src/test/resources/sample-test-schema-yes-auth-with-additional-params-no-catalog.yaml b/framework/src/test/resources/sample-test-schema-yes-auth-with-additional-params-no-catalog.yaml
new file mode 100644
index 00000000..4470e634
--- /dev/null
+++ b/framework/src/test/resources/sample-test-schema-yes-auth-with-additional-params-no-catalog.yaml
@@ -0,0 +1,28 @@
+open_cli_schema_version: 1.0
+
+name: sample-cmd-yes-auth-no-catalog-extra-params
+
+description: sample
+
+
+info:
+ product: open-cli
+ service: test
+ type: cmd
+ author: Kanagaraj Manickam mkr1481@gmail.com
+
+http:
+
+ service:
+ name: sample
+ version: v1
+ auth: testauth
+ mode: catalog
+
+ request:
+ uri: /test
+ method: GET
+ success_codes:
+ - 200
+ result_map:
+ name: ${name}