Search in sources :

Example 6 with Parameters

use of org.onap.so.adapters.appc.orchestrator.client.beans.Parameters in project so by onap.

the class ApplicationControllerTaskImplTest method testExcute_healthCheck.

@Test
public void testExcute_healthCheck() throws JsonProcessingException, ApplicationControllerOrchestratorException {
    request.setAction(Action.HealthCheck);
    Parameters parameters = new Parameters();
    RequestParameters requestParams = new RequestParameters();
    requestParams.setHostIpAddress(request.getApplicationControllerVnf().getVnfHostIpAddress());
    parameters.setRequestParameters(requestParams);
    Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
    Mockito.when(applicationControllerClient.vnfCommand(Action.HealthCheck, "testRequestId", request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType", listener, "testRequestorId")).thenReturn(new Status());
    Status status = applicationControllerTaskImpl.execute("testRequestId", request, listener);
    Mockito.verify(applicationControllerClient).vnfCommand(Action.HealthCheck, "testRequestId", request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType", listener, "testRequestorId");
}
Also used : Status(org.onap.appc.client.lcm.model.Status) Parameters(org.onap.so.adapters.appc.orchestrator.client.beans.Parameters) ConfigurationParameters(org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters) RequestParameters(org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters) RequestParameters(org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters) Test(org.junit.Test)

Example 7 with Parameters

use of org.onap.so.adapters.appc.orchestrator.client.beans.Parameters in project so by onap.

the class ApplicationControllerTaskImplTest method testExcute_quiesceTraffic.

@Test
public void testExcute_quiesceTraffic() throws JsonProcessingException, ApplicationControllerOrchestratorException {
    request.setAction(Action.QuiesceTraffic);
    Parameters parameters = new Parameters();
    parameters.setOperationsTimeout(request.getOperationsTimeout());
    Optional<String> payload = Optional.of((mapper.getMapper().writeValueAsString(parameters)));
    System.out.println("PAYLOAD is: " + payload.get());
    Mockito.when(applicationControllerClient.vnfCommand(request.getAction(), "testRequestId", request.getApplicationControllerVnf().getVnfId(), Optional.empty(), payload, "testControllerType", listener, "testRequestorId")).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, "testRequestorId");
}
Also used : Status(org.onap.appc.client.lcm.model.Status) Parameters(org.onap.so.adapters.appc.orchestrator.client.beans.Parameters) ConfigurationParameters(org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters) RequestParameters(org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters) Test(org.junit.Test)

Example 8 with Parameters

use of org.onap.so.adapters.appc.orchestrator.client.beans.Parameters in project so by onap.

the class ApplicationControllerTaskImplTest method testExcute_distributeTrafficCheck.

@Test
public void testExcute_distributeTrafficCheck() throws JsonProcessingException, ApplicationControllerOrchestratorException {
    request.setAction(Action.DistributeTrafficCheck);
    Parameters parameters = new Parameters();
    ConfigurationParameters configParams = new ConfigurationParameters();
    configParams.setBookName(request.getBookName());
    configParams.setNodeList(request.getNodeList());
    configParams.setFileParameterContent(request.getFileParameters());
    configParams.setVnfName(request.getApplicationControllerVnf().getVnfName());
    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, "testRequestorId")).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, "testRequestorId");
}
Also used : Status(org.onap.appc.client.lcm.model.Status) Parameters(org.onap.so.adapters.appc.orchestrator.client.beans.Parameters) ConfigurationParameters(org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters) RequestParameters(org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters) ConfigurationParameters(org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters) Test(org.junit.Test)

Aggregations

Status (org.onap.appc.client.lcm.model.Status)8 ConfigurationParameters (org.onap.so.adapters.appc.orchestrator.client.beans.ConfigurationParameters)8 Parameters (org.onap.so.adapters.appc.orchestrator.client.beans.Parameters)8 RequestParameters (org.onap.so.adapters.appc.orchestrator.client.beans.RequestParameters)8 Test (org.junit.Test)7 HashMap (java.util.HashMap)1 GraphInventoryCommonObjectMapperProvider (org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider)1 Identity (org.onap.so.adapters.appc.orchestrator.client.beans.Identity)1 ApplicationControllerVm (org.onap.so.appc.orchestrator.service.beans.ApplicationControllerVm)1