From 959493d3274d2f2749586248cf31ee12b730e2af Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 26 Oct 2018 15:05:42 -0400 Subject: Bug fixes October 26th Set non-custom health diagnostic check code to a default value. created custom java serialization for SimpleUri changed property value for cloud-owner in unit test converted aai call to use the AAI Client Correct a JUnit data file to include userParams values that are expected to be set. Set userParams on requestContext to parameters that need to be passed to downstream systems. Change-Id: I3974691875ef967f90a15f076ae27bc0cd76ee8e Issue-ID: SO-1169 Signed-off-by: Benjamin, Max (mb388a) --- .../tasks/BBInputSetupMapperLayerTest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'bpmn/MSOCommonBPMN/src/test/java/org') 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 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")); + } + } -- cgit 1.2.3-korg