use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.
the class ApplicationControllerTaskImplITTest method setup.
@Before
public void setup() {
request = new ApplicationControllerTaskRequest();
request.setRequestorId("testRequestorId");
request.setBookName("testBookName");
request.setControllerType("testControllerType");
request.setFileParameters("testFileParams");
request.setIdentityUrl("testIdentityUrl");
request.setNewSoftwareVersion("2.0");
request.setExistingSoftwareVersion("1.0");
request.setOperationsTimeout("30");
ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf();
applicationControllerVnf.setVnfHostIpAddress("100.100");
applicationControllerVnf.setVnfId("testVnfId");
applicationControllerVnf.setVnfName("testVnfName");
request.setApplicationControllerVnf(applicationControllerVnf);
listener = new ApplicationControllerCallback(null, externalTaskService, appCSupport);
}
use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.
the class ApplicationControllerTask method executeExternalTask.
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
ApplicationControllerTaskRequest request = externalTask.getVariable("appcOrchestratorRequest");
String msoRequestId = externalTask.getVariable("mso-request-id");
logger.debug("Starting External Task for RequestId: {} ", msoRequestId);
Status status = null;
ApplicationControllerCallback listener = new ApplicationControllerCallback(externalTask, externalTaskService, applicationControllerSupport);
try {
status = applicationControllerTaskImpl.execute(msoRequestId, request, listener);
if (status != null && status.getCode() != 0 && !applicationControllerSupport.getCategoryOf(status).equals(StatusCategory.NORMAL)) {
logger.error("The External Task Id: {} Failed locally with status {}", externalTask.getId(), status.getMessage());
externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", status.getMessage());
}
} catch (Exception e) {
logger.error("The External Task Id: {} Failed while calling appc with exception", externalTask.getId(), e.getMessage());
externalTaskService.handleBpmnError(externalTask, "MSOWorkflowException", e.getMessage());
}
}
use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.
the class ApplicationControllerCallbackTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
appcTaskCallback = new ApplicationControllerCallback(mockExternalTask, mockExternalTaskService, applicationControllerSupport);
}
use of org.onap.so.adapters.appc.orchestrator.client.ApplicationControllerCallback in project so by onap.
the class ApplicationControllerTaskImplTest method setup.
@Before
public void setup() {
request = new ApplicationControllerTaskRequest();
request.setBookName("testBookName");
request.setControllerType("testControllerType");
request.setFileParameters("testFileParams");
request.setIdentityUrl("testIdentityUrl");
request.setNewSoftwareVersion("2.0");
request.setExistingSoftwareVersion("1.0");
request.setOperationsTimeout("30");
request.setRequestorId("testRequestorId");
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");
applicationControllerVnf.setVnfName("testVnfName");
request.setApplicationControllerVnf(applicationControllerVnf);
listener = new ApplicationControllerCallback(null, null, null);
}
Aggregations