aboutsummaryrefslogtreecommitdiffstats
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/cmd/OnapHttpCommandTest.java8
-rw-r--r--framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java8
-rw-r--r--framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java16
-rw-r--r--framework/src/test/resources/sample-cmd-test-help.txt10
-rw-r--r--framework/src/test/resources/sample-test-include-exclude.yaml4
-rw-r--r--framework/src/test/resources/sample-test-include-param.yaml4
-rw-r--r--framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml2
-rw-r--r--framework/src/test/resources/sample-test-invalid-include-noauth.yaml2
8 files changed, 27 insertions, 27 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java
index bfdb14a5..7552cacb 100644
--- a/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java
@@ -31,12 +31,12 @@ public class OnapHttpCommandTest {
@Test(expected = OnapCommandException.class)
public void runTest() throws OnapCommandException {
OnapCommandParameter param1 = new OnapCommandParameter();
- param1.setLongOption("onap-username");
- param1.setName("onap-username");
+ param1.setLongOption("host-username");
+ param1.setName("host-username");
param1.setParameterType(ParameterType.STRING);
OnapCommandParameter param2 = new OnapCommandParameter();
- param2.setLongOption("onap-password");
- param2.setName("onap-password");
+ param2.setLongOption("host-password");
+ param2.setName("host-password");
param2.setParameterType(ParameterType.STRING);
OnapCommandParameter param3 = new OnapCommandParameter();
param3.setLongOption("host-url");
diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java
index 89c32c99..2355d668 100644
--- a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java
+++ b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java
@@ -28,9 +28,9 @@ public class OnapSchemaValidateCommandTest {
OnapSchemaValidateCommand cmd = new OnapSchemaValidateCommand();
cmd.initializeSchema("schema-validate.yaml");
for (OnapCommandParameter param : cmd.getParameters()) {
- if ("onap-username".equals(param.getName())) {
+ if ("host-username".equals(param.getName())) {
param.setValue("test");
- } else if ("onap-password".equals(param.getName())) {
+ } else if ("host-password".equals(param.getName())) {
param.setValue("test");
} else if ("host-url".equals(param.getName())) {
param.setValue("test-url");
@@ -48,9 +48,9 @@ public class OnapSchemaValidateCommandTest {
OnapSchemaValidateCommand cmd = new OnapSchemaValidateCommand();
cmd.initializeSchema("schema-validate.yaml");
for (OnapCommandParameter param : cmd.getParameters()) {
- if ("onap-username".equals(param.getName())) {
+ if ("host-username".equals(param.getName())) {
param.setValue("test");
- } else if ("onap-password".equals(param.getName())) {
+ } else if ("host-password".equals(param.getName())) {
param.setValue("test");
} else if ("host-url".equals(param.getName())) {
param.setValue("test-url");
diff --git a/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java b/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java
index 20ca10f7..b0590791 100644
--- a/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java
+++ b/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java
@@ -41,8 +41,8 @@ public class TestDefaultParameterSection {
OnapCommandUtils.loadSchema(cmd, "sample-test-include-param.yaml", true, false);
List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
- assertTrue(parameters.contains("onap-username"));
- assertTrue(parameters.contains("onap-password"));
+ assertTrue(parameters.contains("host-username"));
+ assertTrue(parameters.contains("host-password"));
assertTrue(parameters.contains("host-url"));
}
@@ -55,8 +55,8 @@ public class TestDefaultParameterSection {
OnapCommandUtils.loadSchema(cmd, "sample-test-exclude-param.yaml", true, false);
List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
- assertTrue(parameters.contains("onap-username"));
- assertTrue(parameters.contains("onap-password"));
+ assertTrue(parameters.contains("host-username"));
+ assertTrue(parameters.contains("host-password"));
assertTrue(parameters.contains("host-url"));
assertFalse(parameters.contains("long"));
assertFalse(parameters.contains("format"));
@@ -73,8 +73,8 @@ public class TestDefaultParameterSection {
OnapCommandUtils.loadSchema(cmd, "sample-test-include-exclude.yaml", true, false);
List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
- assertTrue(parameters.contains("onap-username"));
- assertTrue(parameters.contains("onap-password"));
+ assertTrue(parameters.contains("host-username"));
+ assertTrue(parameters.contains("host-password"));
assertTrue(parameters.contains("host-url"));
}
@@ -88,8 +88,8 @@ public class TestDefaultParameterSection {
OnapCommandUtils.loadSchema(cmd, "onap-test-schema.yaml", true, false);
List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList());
- assertFalse(parameters.contains("onap-username"));
- assertFalse(parameters.contains("onap-password"));
+ assertFalse(parameters.contains("host-username"));
+ assertFalse(parameters.contains("host-password"));
assertTrue(parameters.contains("host-url"));
assertTrue(parameters.contains("debug"));
assertTrue(parameters.contains("long"));
diff --git a/framework/src/test/resources/sample-cmd-test-help.txt b/framework/src/test/resources/sample-cmd-test-help.txt
index 074e833e..3d3d2415 100644
--- a/framework/src/test/resources/sample-cmd-test-help.txt
+++ b/framework/src/test/resources/sample-cmd-test-help.txt
@@ -5,7 +5,7 @@ Onap sample command to test the command features
Onap service: sample v1
Options:
-[-u | --onap-username] [-p | --onap-password] [-m | --host-url]
+[-u | --host-username] [-p | --host-password] [-m | --host-url]
[-h | --help] [-v | --version] [-d | --debug]
[-f | --format] [-s | --long] [-t | --no-title]
[-a | --no-auth] [-b | --bool] [-x | --secure]
@@ -13,12 +13,12 @@ Options:
[-l | --long-opt] [-r | --url] [-z | --env]
<positional-args>
where,
--u | --onap-username Onap user name. It is of type STRING. By
+-u | --host-username Onap user name. It is of type STRING. By
default, it is read from environment variable
- ONAP_USERNAME.
--p | --onap-password Onap user password. It is of type STRING. By
+ HOST_USERNAME.
+-p | --host-password Onap user password. It is of type STRING. By
default, it is read from environment variable
- ONAP_PASSWORD. Secured.
+ HOST_PASSWORD. Secured.
-m | --host-url Onap MSB url. It is of type URL. By default, it
is read from environment variable ONAP_MSB_URL.
-h | --help Onap command help message. It is of type STRING.
diff --git a/framework/src/test/resources/sample-test-include-exclude.yaml b/framework/src/test/resources/sample-test-include-exclude.yaml
index 77d3211c..3568372b 100644
--- a/framework/src/test/resources/sample-test-include-exclude.yaml
+++ b/framework/src/test/resources/sample-test-include-exclude.yaml
@@ -1,8 +1,8 @@
open_cli_schema_version: 1.0
default_parameters:
include:
- - onap-username
- - onap-password
+ - host-username
+ - host-password
- host-url
- no-auth
exclude:
diff --git a/framework/src/test/resources/sample-test-include-param.yaml b/framework/src/test/resources/sample-test-include-param.yaml
index 18097129..38e5149e 100644
--- a/framework/src/test/resources/sample-test-include-param.yaml
+++ b/framework/src/test/resources/sample-test-include-param.yaml
@@ -1,6 +1,6 @@
open_cli_schema_version: 1.0
default_parameters:
include:
- - onap-username
- - onap-password
+ - host-username
+ - host-password
- no-auth
diff --git a/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml b/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml
index 1a42b8d4..c1584116 100644
--- a/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml
+++ b/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml
@@ -1,4 +1,4 @@
open_cli_schema_version: 1.0
default_parameters:
exclude:
- - onap-username \ No newline at end of file
+ - host-username \ No newline at end of file
diff --git a/framework/src/test/resources/sample-test-invalid-include-noauth.yaml b/framework/src/test/resources/sample-test-invalid-include-noauth.yaml
index 2d53ab11..1dda3b96 100644
--- a/framework/src/test/resources/sample-test-invalid-include-noauth.yaml
+++ b/framework/src/test/resources/sample-test-invalid-include-noauth.yaml
@@ -3,4 +3,4 @@ service:
auth: none
default_parameters:
include:
- - onap-username \ No newline at end of file
+ - host-username \ No newline at end of file