diff options
author | Bharath Thiruveedula <bharath_ves@hotmail.com> | 2017-08-07 08:28:13 +0530 |
---|---|---|
committer | Bharath Thiruveedula <bharath_ves@hotmail.com> | 2017-08-26 00:02:33 +0530 |
commit | a7a64477c28b433ba05afbe65155450d6ae3cba8 (patch) | |
tree | 103e4301b0831fe81193b65971ed66ebbd56828d /framework/src/test | |
parent | 42ad121a52d01dd203c529f2ba7753f82d45ec21 (diff) |
Add VSP lifecycle commands
Change-Id: Ibdc78b3ab1921c160f8ee193fcd47be0c75f94a9
Issue-ID: CLI-16
Signed-off-by: Bharath T<bharath.thiruveedula@verizon.com>
Diffstat (limited to 'framework/src/test')
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientTest.java | 22 | ||||
-rw-r--r-- | framework/src/test/resources/onap.properties | 7 |
2 files changed, 23 insertions, 6 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientTest.java b/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientTest.java index f98846c6..c57be7d2 100644 --- a/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientTest.java +++ b/framework/src/test/java/org/onap/cli/fw/ad/OnapAuthClientTest.java @@ -16,6 +16,9 @@ package org.onap.cli.fw.ad; +import java.util.ArrayList; +import java.util.List; + import static org.junit.Assert.assertEquals; import org.junit.AfterClass; @@ -30,6 +33,7 @@ import org.onap.cli.fw.error.OnapCommandServiceNotFound; import org.onap.cli.fw.http.HttpInput; import org.onap.cli.fw.http.HttpResult; import org.onap.cli.fw.http.OnapHttpConnection; +import org.onap.cli.fw.input.OnapCommandParameter; import mockit.Invocation; import mockit.Mock; @@ -40,15 +44,19 @@ public class OnapAuthClientTest { OnapAuthClient client; @Before - public void setUp() throws OnapCommandHttpFailure { + public void setUp() throws OnapCommandHttpFailure, OnapCommandException { OnapCredentials creds = new OnapCredentials("test", "test123", "http://192.168.99.10:80"); - client = new OnapAuthClient(creds, true); + OnapService service = new OnapService(); + List<OnapCommandParameter> params = new ArrayList<>(); + client = new OnapAuthClient(creds, true, service, params); } @Test public void loginFailedAuthIgnoredTest() throws OnapCommandException { OnapCredentials creds = new OnapCredentials("test", "test123", "http://192.168.99.10:80"); - OnapAuthClient client = new OnapAuthClient(creds, true); + OnapService service = new OnapService(); + List<OnapCommandParameter> params = new ArrayList<>(); + OnapAuthClient client = new OnapAuthClient(creds, true, service, params); if (OnapCommandConfg.isAuthIgnored()) { client.getDebugInfo(); client.login(); @@ -58,7 +66,9 @@ public class OnapAuthClientTest { @Test public void logoutFailedAuthIgnoredTest() throws OnapCommandException { OnapCredentials creds = new OnapCredentials("test", "test123", "http://192.168.99.10:80"); - OnapAuthClient client = new OnapAuthClient(creds, true); + OnapService service = new OnapService(); + List<OnapCommandParameter> params = new ArrayList<>(); + OnapAuthClient client = new OnapAuthClient(creds, true, service, params); if (OnapCommandConfg.isAuthIgnored()) { client.logout(); } @@ -67,7 +77,9 @@ public class OnapAuthClientTest { @Test public void getMsbUrlTest() throws OnapCommandException { OnapCredentials creds = new OnapCredentials("test", "test123", "http://192.168.99.10:80"); - OnapAuthClient client = new OnapAuthClient(creds, true); + OnapService service = new OnapService(); + List<OnapCommandParameter> params = new ArrayList<>(); + OnapAuthClient client = new OnapAuthClient(creds, true, service, params); OnapService srv = new OnapService(); srv.setName("msb"); String msb = client.getServiceBasePath(srv); diff --git a/framework/src/test/resources/onap.properties b/framework/src/test/resources/onap.properties index 8a2756e4..cdbbfa84 100644 --- a/framework/src/test/resources/onap.properties +++ b/framework/src/test/resources/onap.properties @@ -20,6 +20,11 @@ cli.http.basic.common_headers.x-transaction-id.value=req-uuid cli.http.basic.common_headers.x-app-id=X-FromAppId cli.http.basic.common_headers.x-app-id.value=onap-cli +# Service specific headers +cli.http.basic.common_headers.sdc=user-id +cli.http.basic.common_headers.sdc.user-id=USER_ID +cli.http.basic.common_headers.sdc.user-id.value=${onap-username} + #TODO mrkanag add support for aaf like defined above for basic #cli.service.auth=aaf @@ -46,4 +51,4 @@ cli.schema.http_methods=post,get,delete,put,head cli.schema.boolean_values=true,false cli.schema.auth_values=none,basic -cli.schema.mode_values=direct,catalog
\ No newline at end of file +cli.schema.mode_values=direct,catalog |