From 9484ccd079c2818f040a9b15fe744f6845efb76a Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 20 Feb 2019 16:48:49 -0500 Subject: assignvfmodulebb must send use-preload Corrections to JUnit data to account for usePreload usage. Resurrect usage of usePreload value and pass fromPreload to SDNC. Change-Id: I6fb52f6abf09ec501e90335a01e37db1c10ae2b3 Issue-ID: SO-1539 Signed-off-by: Benjamin, Max (mb388a) --- .../tasks/BBInputSetupMapperLayerTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/onap') 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; + } + } -- cgit 1.2.3-korg