diff options
author | Elena Kuleshov <evn@att.com> | 2019-09-12 15:55:39 -0400 |
---|---|---|
committer | Elena Kuleshov <evn@att.com> | 2019-09-12 15:55:39 -0400 |
commit | 4b5f7e4cd1b6aeaeecc3f430bae6b45c13db4c01 (patch) | |
tree | b92c14ade8a7b1f6075a03650340dbc4a6e2af4d /bpmn/so-bpmn-tasks/src/test/java | |
parent | f4f42b9b89880e8992c483255ed04863a3577f64 (diff) |
Build payload APPC parameter from UserParams
If a payload parameter is not specified on VID request for APPC interaction, we will need to build it from UserParams from requestCOntext.
Issue-ID: SO-2311
Signed-off-by: Kuleshov, Elena <evn@att.com>
Change-Id: Ie6affe2bad031d80c43c0358a49cb252fb04f5e2
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java index cc25689358..f0c333007e 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java @@ -33,6 +33,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; import java.util.Optional; import org.junit.Test; import org.mockito.InjectMocks; @@ -168,6 +170,21 @@ public class AppcRunTasksTest extends BaseTaskTest { assertEquals(vmIdList, expectedVmIdList); } + @Test + public void testUserParams() throws Exception { + Map<String, Object> userParams = new HashMap<String, Object>(); + userParams.put("existing_software_version", "3.1"); + userParams.put("new_software_version", "3.2"); + userParams.put("operations_timeout", "150000"); + + String actualPayload = appcRunTasks.buildPayloadFromUserParams(userParams); + System.out.println(actualPayload); + String expectedPayload = + "{\\\"operations_timeout\\\":\\\"150000\\\",\\\"existing_software_version\\\":\\\"3.1\\\",\\\"new_software_version\\\":\\\"3.2\\\"}"; + assertEquals(expectedPayload, actualPayload.replaceAll(" ", "")); + + } + private void mockReferenceResponse() { ControllerSelectionReference reference = new ControllerSelectionReference(); reference.setControllerName("TEST-CONTROLLER-NAME"); |