aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-02-22 15:14:25 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-22 15:14:25 +0000
commite82e1e68a19a3700030ebc3247ed562618cacfe4 (patch)
tree244a93378403dc7a22f7d7631e1b26b35cae683f /bpmn/MSOCommonBPMN/src
parentd35a30a42edab60d8801bb3a2060548e2b9d1d35 (diff)
parent9484ccd079c2818f040a9b15fe744f6845efb76a (diff)
Merge "assignvfmodulebb must send use-preload"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java16
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java1
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java22
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqParameters.json37
4 files changed, 76 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java
index 5e49ffcf40..1e390701df 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java
@@ -49,6 +49,8 @@ public class RequestParameters implements Serializable {
private Boolean aLaCarte;
@JsonProperty("payload")
private String payload;
+ @JsonProperty("usePreload")
+ private Boolean usePreload;
public String getSubscriptionServiceType() {
return subscriptionServiceType;
@@ -95,6 +97,20 @@ public class RequestParameters implements Serializable {
}
return null;
}
+
+ public Boolean isUsePreload() {
+ return usePreload;
+ }
+
+ @JsonProperty("usePreload")
+ public Boolean getUsePreload() {
+ return usePreload;
+ }
+
+ @JsonProperty("usePreload")
+ public void setUsePreload(Boolean usePreload) {
+ this.usePreload = usePreload;
+ }
@JsonInclude(Include.NON_NULL)
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index 1e77c35ee3..641f7f557c 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -346,6 +346,7 @@ public class BBInputSetupMapperLayer {
protected RequestParameters mapRequestParameters(org.onap.so.serviceinstancebeans.RequestParameters requestParameters) {
RequestParameters requestParams = new RequestParameters();
requestParams.setaLaCarte(requestParameters.getALaCarte());
+ requestParams.setUsePreload(requestParameters.getUsePreload());
requestParams.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
requestParams.setUserParams(requestParameters.getUserParams());
requestParams.setPayload(requestParameters.getPayload());
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 1babac68ca..7e76e52959 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,7 @@ 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.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -53,6 +54,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoCollection;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
@@ -653,4 +655,24 @@ public class BBInputSetupMapperLayerTest {
assertFalse(actual.containsValue("ignore"));
}
+ @Test
+ public void testMapRequestParameters() throws IOException {
+ RequestDetails requestDetails = mapper.readValue(new File(RESOURCE_PATH + "RequestDetailsInput_mapReqContext.json"), RequestDetails.class);
+ RequestParameters actual = bbInputSetupMapperLayer.mapRequestParameters(requestDetails.getRequestParameters());
+
+ assertEquals(actual.getUsePreload(), requestDetails.getRequestParameters().getUsePreload());
+ assertEquals(actual.getSubscriptionServiceType(), requestDetails.getRequestParameters().getSubscriptionServiceType());
+ assertEquals(actual.getPayload(), requestDetails.getRequestParameters().getPayload());
+ }
+
+ protected RequestParameters mapRequestParameters(org.onap.so.serviceinstancebeans.RequestParameters requestParameters) {
+ RequestParameters requestParams = new RequestParameters();
+ requestParams.setaLaCarte(requestParameters.getALaCarte());
+ requestParams.setUsePreload(requestParameters.getUsePreload());
+ requestParams.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
+ requestParams.setUserParams(requestParameters.getUserParams());
+ requestParams.setPayload(requestParameters.getPayload());
+ return requestParams;
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqParameters.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqParameters.json
new file mode 100644
index 0000000000..788c27b3fe
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_mapReqParameters.json
@@ -0,0 +1,37 @@
+{
+ "requestInfo": {
+ "callbackUrl": "callbackURL",
+ "productFamilyId": "productFamilyId",
+ "source": "source",
+ "suppressRollback": false,
+ "requestorId": "requestorId"
+ },
+ "requestParameters": {
+ "subscriptionServiceType": "subscriptionServiceType",
+ "aLaCarte": false,
+ "usePreload": false,
+ "payload": "string123",
+ "userParams": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ },
+ {
+ "ignore": "false",
+ "skip": "ignore"
+ }
+ ]
+
+ },
+ "configurationParameters": [
+ {
+ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]",
+ "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]"
+ }
+ ]
+}
+