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");
}
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");
}
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");
}
Aggregations