aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-10-31 10:21:22 -0400
committerRob Daugherty <rd472p@att.com>2018-10-31 10:38:00 -0400
commit6b4910cc194286bccb2a63f63d12bfefcdb7fb3f (patch)
treef140576b3c42c0b575bfe5ab0cf11bffc23f708e /bpmn/MSOCommonBPMN/src/test
parent9390b58f5e502bfdf5d0127a4cc5b45e12f17cb6 (diff)
parenta233b62a56517e06ce63b8d801bcdebd6df18af5 (diff)
10/31: merge casablanca to master
Commit: 649c4e85cc991ffe9c13fd3fab4cc3a303faa656 Subject: Fix Error, Check that vimID is present Issue: SO-1156 https://gerrit.onap.org/r/#/c/71247/ Commit: 959493d3274d2f2749586248cf31ee12b730e2af Subject: Bug fixes October 26th Issue: SO-1169 https://gerrit.onap.org/r/#/c/71343/ Commit: 373c057bfa82583f615ea46814ad3cdf9ea8d669 Subject: Resolve vf_module_id setting bug Issue: SO-1165 https://gerrit.onap.org/r/#/c/71270/ Commit: 6c2c8a66fade016f74b51bdfea3ba04494530b97 Issue: SO-1102 Subject: Pnf Spring Environment correction https://gerrit.onap.org/r/#/c/71137/ Change-Id: I22b4566050f627e1f1428aacdb52ec4d4fe75733 Issue-ID: SO-1173 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java19
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json1
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json21
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json24
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json17
5 files changed, 75 insertions, 7 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
index 94dbbf427c..1babac68ca 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
@@ -23,6 +23,8 @@ package org.onap.so.bpmn.servicedecomposition.tasks;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
@@ -33,7 +35,6 @@ import java.util.List;
import java.util.Map;
import org.junit.Test;
-import org.mockito.InjectMocks;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
@@ -636,4 +637,20 @@ public class BBInputSetupMapperLayerTest {
assertThat(actual, sameBeanAs(expected));
}
+
+ @Test
+ public void testMapNameValueUserParams() throws IOException {
+ RequestDetails requestDetails = mapper.readValue(new File(RESOURCE_PATH + "RequestDetailsInput_mapReqContext.json"), RequestDetails.class);
+ HashMap<String,String> actual = bbInputSetupMapperLayer.mapNameValueUserParams(requestDetails.getRequestParameters());
+
+ assertTrue(actual.containsKey("name1"));
+ assertTrue(actual.containsValue("value1"));
+ assertTrue(actual.get("name1").equals("value1"));
+ assertTrue(actual.containsKey("name2"));
+ assertTrue(actual.containsValue("value2"));
+ assertTrue(actual.get("name2").equals("value2"));
+ assertFalse(actual.containsKey("ignore"));
+ assertFalse(actual.containsValue("ignore"));
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
index 8640c2e899..a53ed4dfde 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
@@ -1,6 +1,7 @@
{
"requestContext": {
"source": "VID",
+ "user-params": {},
"mso-request-id": "requestId",
"action": "createInstance",
"requestParameters": {
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
index cf65143c9a..926bf2ccb7 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
@@ -5,11 +5,28 @@
"requestor-id": "requestorId",
"mso-request-id": "requestId",
"subscription-service-type": "subscriptionServiceType",
- "user-params": null,
+ "user-params": {
+ "name1": "value1",
+ "name2": "value2"
+ },
"action": "createInstance",
"callback-url": "callbackURL",
"requestParameters": {
- "subscriptionServiceType": "subscriptionServiceType"
+ "subscriptionServiceType": "subscriptionServiceType",
+ "userParams": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ },
+ {
+ "ignore": "false",
+ "skip": "ignore"
+ }
+ ]
}
},
"orchContext": {
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
index 6f82a9dd75..dfc6d4f555 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestContextExpected.json
@@ -2,11 +2,29 @@
"product-family-id": "productFamilyId",
"source": "source",
"requestor-id": "requestorId",
- "subscription-service-type": "subscriptionServiceType",
- "user-params": null,
+ "subscription-service-type": "subscriptionServiceType",
"action": null,
"callback-url": "callbackURL",
+ "user-params": {
+ "name1": "value1",
+ "name2": "value2"
+ },
"requestParameters": {
- "subscriptionServiceType": "subscriptionServiceType"
+ "subscriptionServiceType": "subscriptionServiceType",
+ "userParams": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ },
+ {
+ "ignore": "false",
+ "skip": "ignore"
+ }
+ ]
}
+
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
index e91875135b..7386828d27 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqContext.json
@@ -7,7 +7,22 @@
"requestorId": "requestorId"
},
"requestParameters": {
- "subscriptionServiceType": "subscriptionServiceType"
+ "subscriptionServiceType": "subscriptionServiceType",
+ "userParams": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ },
+ {
+ "ignore": "false",
+ "skip": "ignore"
+ }
+ ]
+
}
}