From a7a64477c28b433ba05afbe65155450d6ae3cba8 Mon Sep 17 00:00:00 2001 From: Bharath Thiruveedula Date: Mon, 7 Aug 2017 08:28:13 +0530 Subject: Add VSP lifecycle commands Change-Id: Ibdc78b3ab1921c160f8ee193fcd47be0c75f94a9 Issue-ID: CLI-16 Signed-off-by: Bharath T --- .../org/onap/cli/fw/ad/OnapAuthClientTest.java | 22 +++++++++++++++++----- framework/src/test/resources/onap.properties | 7 ++++++- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'framework/src/test') 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 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 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 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 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 -- cgit 1.2.3-korg