diff options
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); |