diff options
author | Bonkur, Venkat <venkat.bonkur@att.com> | 2020-03-25 17:02:20 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-03-25 17:02:20 -0400 |
commit | a5c5b045553342376e240a506a05d0f7b947d191 (patch) | |
tree | 9084496bed0680757858dbf1853ad0eaecd5611d /adapters/so-appc-orchestrator/src/test | |
parent | f5420060c758308df18a0e316d6ae214ef9eb5c6 (diff) |
mso vnf configuration update composite flow
Existing Change Management VNF Configuration Update flow migrated to
the generic building blocks
Introduced Activity BB VNFConfigModifyActivity.bpmn
Updates to AppcOrcherationPreProcessor, ApplicationControllerTaskImpl
to handle the ConfigModify Activity block.
Updates to the catalog migration scripts to include VNF-Config-Update
Macro flow.
Issue-ID: SO-2768
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I06be7a83fb2738b91b0257e1ec84298a7dafc1a1
Diffstat (limited to 'adapters/so-appc-orchestrator/src/test')
-rw-r--r-- | adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java index 640e2dbd6e..973430c37e 100644 --- a/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java +++ b/adapters/so-appc-orchestrator/src/test/java/org/onap/so/adapters/appc/orchestrator/service/ApplicationControllerTaskImplTest.java @@ -1,5 +1,7 @@ package org.onap.so.adapters.appc.orchestrator.service; +import java.util.HashMap; +import java.util.Map; import java.util.Optional; import org.junit.Before; import org.junit.Test; @@ -50,6 +52,10 @@ public class ApplicationControllerTaskImplTest { request.setNewSoftwareVersion("2.0"); request.setExistingSoftwareVersion("1.0"); request.setOperationsTimeout("30"); + Map<String, String> reqConfigParams = new HashMap<>(); + reqConfigParams.put("name1", "value1"); + reqConfigParams.put("name2", "value2"); + request.setConfigParams(reqConfigParams); ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf(); applicationControllerVnf.setVnfHostIpAddress("100.100"); applicationControllerVnf.setVnfId("testVnfId"); @@ -228,6 +234,33 @@ public class ApplicationControllerTaskImplTest { } @Test + public void testExcute_configModify() throws JsonProcessingException, ApplicationControllerOrchestratorException { + request.setAction(Action.ConfigModify); + + Parameters parameters = new Parameters(); + RequestParameters requestParams = new RequestParameters(); + requestParams.setHostIpAddress(request.getApplicationControllerVnf().getVnfHostIpAddress()); + parameters.setRequestParameters(requestParams); + ConfigurationParameters configParams = new ConfigurationParameters(); + Map<String, String> configParamMap = new HashMap<>(); + configParamMap.put("name1", "value1"); + configParamMap.put("name2", "value2"); + configParams.setAdditionalProperties(configParamMap); + parameters.setConfigurationParameters(configParams); + Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters))); + + Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId", + request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType", + listener)).thenReturn(new Status()); + + Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener); + + Mockito.verify(applicationControllerClient).vnfCommand(request.getAction(), "testRequestId", + request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType", + listener); + } + + @Test public void testListener() throws Exception { request.setAction(Action.QuiesceTraffic); Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener); |