From 1ecc057676a6ef788d5193261abd98bd364f10c0 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 20 Sep 2017 16:34:10 +0530 Subject: Migrate onap-username and onap-password onap-username and onap-password are migrated into host-username and host-password respectively Issue-Id: CLI-66 Change-Id: I4d658283523e75a2223dac9d0b839fdbc6ae2da3 Signed-off-by: Kanagaraj Manickam k00365106 --- .../test/java/org/onap/cli/main/OnapCliMainTest.java | 4 ++-- .../java/org/onap/cli/main/utils/OnapCliUtilsTest.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'main/src/test/java') 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 092ef8d8..0ac00d1f 100644 --- a/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java +++ b/main/src/test/java/org/onap/cli/main/OnapCliMainTest.java @@ -136,8 +136,8 @@ public class OnapCliMainTest { @Test public void testHandleSampleCommandSet() throws OnapCommandException { OnapCommandRegistrar.getRegistrar().addParamCache("sample:string-param", "paramValue"); - OnapCommandRegistrar.getRegistrar().addParamCache("onap-username", "paramValue"); - OnapCommandRegistrar.getRegistrar().addParamCache("onap-password", "paramValue"); + OnapCommandRegistrar.getRegistrar().addParamCache("host-username", "paramValue"); + OnapCommandRegistrar.getRegistrar().addParamCache("host-password", "paramValue"); OnapCommandRegistrar.getRegistrar().addParamCache("host-url", "paramValue"); this.handle(new String[] { "sample-test", "--string-param", "test"}); } diff --git a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java index 622cea5f..1ea1a22d 100644 --- a/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java +++ b/main/src/test/java/org/onap/cli/main/utils/OnapCliUtilsTest.java @@ -34,12 +34,12 @@ public class OnapCliUtilsTest { @Test public void testpopulateParamsLong() 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"); @@ -61,13 +61,13 @@ public class OnapCliUtilsTest { paramslist.add(param4); paramslist.add(param5); - String[] args = new String[] { "sample-create", "--onap-username", "admin", "--onap-password", "123", + String[] args = new String[] { "sample-create", "--host-username", "admin", "--host-password", "123", "--host-url", "a@b.com", "--string-param", "blah", "--long-opt", "10" }; OnapCliUtils.populateParams(paramslist, Arrays.asList(args)); List expectedList = Arrays.asList(args); - Assert.assertEquals("onap-username", expectedList.get(2), param1.getValue()); - Assert.assertEquals("onap-password", expectedList.get(4), param2.getValue()); + Assert.assertEquals("host-username", expectedList.get(2), param1.getValue()); + Assert.assertEquals("host-password", expectedList.get(4), param2.getValue()); Assert.assertEquals("host-url", expectedList.get(6), param3.getValue()); Assert.assertEquals("string-param", expectedList.get(8), param4.getValue()); Assert.assertEquals("long-opt", expectedList.get(10), param5.getValue()); @@ -184,11 +184,11 @@ public class OnapCliUtilsTest { OnapCommandParameter param1 = new OnapCommandParameter(); param1.setShortOption("u"); - param1.setName("onap-username"); + param1.setName("host-username"); param1.setParameterType(ParameterType.STRING); OnapCommandParameter param2 = new OnapCommandParameter(); param2.setShortOption("p"); - param2.setName("onap-password"); + param2.setName("host-password"); param2.setParameterType(ParameterType.STRING); OnapCommandParameter param3 = new OnapCommandParameter(); param3.setShortOption("r"); -- cgit 1.2.3-korg