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/ad/OnapAuthClientTest.java22
-rw-r--r--framework/src/test/resources/onap.properties7
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