aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql34
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java10
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java1
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java2
-rw-r--r--adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java9
-rw-r--r--adapters/mso-nssmf-adapter/src/main/resources/application.yaml2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java7
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java7
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java2
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java31
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java52
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java80
16 files changed, 202 insertions, 57 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
index e4810840f1..622a9c93c5 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
@@ -74,17 +74,17 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FL
('Service-Macro-Create', '7', 'ConfigAssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
('Service-Macro-Create', '8', 'AssignPnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
('Service-Macro-Create', '9', 'WaitForPnfReadyBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '11', 'ActivatePnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '12', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '13', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '14', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '15', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '16', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '17', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '18', 'ConfigDeployVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '19', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '20', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
-('Service-Macro-Create', '21', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '12', 'ActivatePnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '13', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '14', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '15', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '16', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '17', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '18', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '19', 'ConfigDeployVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '20', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '21', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
+('Service-Macro-Create', '22', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')),
('Service-Macro-Delete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')),
('Service-Macro-Delete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')),
('Service-Macro-Delete', '3', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')),
@@ -228,6 +228,8 @@ values (902, 'VNF-Macro-Modify',2,'ControllerExecutionBB',1,500,'vnf','config-de
INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID, SCOPE, ACTION) VALUES
('Service-Macro-Create', '10', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT'), 'pnf', 'config-assign');
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID, SCOPE, ACTION) VALUES
+('Service-Macro-Create', '11', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT'), 'pnf', 'config-deploy');
INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
VALUES
@@ -949,13 +951,3 @@ VALUES
('VNFConfigModifyActivity','*','*','*','*','Manual','Abort','*', '*'),
('VNFUnsetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'),
('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*');
-
-UPDATE orchestration_flow_reference set FLOW_NAME='ControllerExecutionBB', SCOPE='vnf', ACTION='config-assign' WHERE COMPOSITE_ACTION = 'Service-Macro-Create' and FLOW_NAME = 'ConfigAssignVnfBB';
-UPDATE orchestration_flow_reference set FLOW_NAME='ControllerExecutionBB', SCOPE='vnf', ACTION='config-deploy' WHERE COMPOSITE_ACTION = 'Service-Macro-Create' and FLOW_NAME = 'ConfigDeployVnfBB';
-UPDATE orchestration_flow_reference set FLOW_NAME='ControllerExecutionBB', SCOPE='vnf', ACTION='HealthCheck' WHERE COMPOSITE_ACTION = 'VFModule-ScaleOut' and FLOW_NAME = 'GenericVnfHealthCheckBB';
-UPDATE orchestration_flow_reference set FLOW_NAME='ControllerExecutionBB', SCOPE='vfmodule', ACTION='ScaleOutReconfiguration' WHERE COMPOSITE_ACTION = 'VFModule-ScaleOut' and FLOW_NAME = 'GenericVnfHealthCheckBB';
-
-INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID, SCOPE, ACTION) VALUES
-('VFModule-Delete', '1', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'DEFAULT'), "vnf", "HealthCheck"),
-('VFModule-Delete', '2', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'DEFAULT'), "vfmodule", "ScaleInReconfiguration"),
-('VFModule-Delete', '6', 'ControllerExecutionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'DEFAULT'), "vnf", "HealthCheck"); \ No newline at end of file
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
index c4f269c3a0..789f4f239d 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
@@ -210,10 +210,12 @@ public abstract class BaseNssmfManager implements NssmfManager {
private void urlHandler() {
NssmfUrlInfo nssmfUrlInfo =
NssmfAdapterConsts.getNssmfUrlInfo(this.executorType, this.esrInfo.getNetworkType(), actionType);
- this.nssmfUrl = nssmfUrlInfo.getUrl();
- this.httpMethod = nssmfUrlInfo.getHttpMethod();
- this.nssmfUrl = nssmfUrl.replaceAll("\\{apiVersion}", getApiVersion());
- this.params.forEach((k, v) -> this.nssmfUrl = this.nssmfUrl.replaceAll("\\{" + k + "}", v));
+ if (nssmfUrlInfo != null) {
+ this.nssmfUrl = nssmfUrlInfo.getUrl();
+ this.httpMethod = nssmfUrlInfo.getHttpMethod();
+ this.nssmfUrl = nssmfUrl.replaceAll("\\{apiVersion}", getApiVersion());
+ this.params.forEach((k, v) -> this.nssmfUrl = this.nssmfUrl.replaceAll("\\{" + k + "}", v));
+ }
}
/**
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
index bb2b83fd59..72d1b53781 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
@@ -95,6 +95,7 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
return marshal(actDeActNssi);
}
+ @Override
protected RestResponse doQueryJobStatus(ResourceOperationStatus status) throws ApplicationException {
return doResponseStatus(status);
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java
index 4705e871f3..88b5071371 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/InternalNssmfManager.java
@@ -98,7 +98,7 @@ public abstract class InternalNssmfManager extends BaseNssmfManager {
// internal
private RestResponse sendInternalRequest(String content) {
- Header header = new BasicHeader("X-Auth-Token", adapterConfig.getInfraAuth());
+ Header header = new BasicHeader("Authorization", adapterConfig.getInfraAuth());
this.nssmfUrl = adapterConfig.getInfraEndpoint() + this.nssmfUrl;
return restUtil.send(this.nssmfUrl, this.httpMethod, content, header);
}
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java
index a7adbe116a..7a86c5ba2b 100644
--- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java
+++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/util/RestUtil.java
@@ -270,6 +270,7 @@ public class RestUtil {
class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
public static final String METHOD_NAME = "DELETE";
+ @Override
public String getMethod() {
return METHOD_NAME;
}
@@ -316,12 +317,15 @@ public class RestUtil {
public HttpClient getHttpsClient() {
TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
+ @Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
+ @Override
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
+ @Override
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
}};
@@ -329,10 +333,9 @@ public class RestUtil {
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
- // HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
- SSLConnectionSocketFactory sslsf =
- new SSLConnectionSocketFactory(sc, new String[] {"TLSv1"}, null, (s, sslSession) -> true);
+ SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sc,
+ new String[] {"TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}, null, (s, sslSession) -> true);
return HttpClients.custom().setSSLSocketFactory(sslsf).build();
} catch (Exception e) {
throw new IllegalArgumentException(e);
diff --git a/adapters/mso-nssmf-adapter/src/main/resources/application.yaml b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
index 8da911d4e0..5501fba88f 100644
--- a/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml
@@ -59,7 +59,7 @@ mso:
endpoint: https://so-request-db-adapter.{{ include "common.namespace" . }}:8083
auth: Basic YnBlbDpwYXNzd29yZDEk
infra:
- endpoint: https://so.{{ include "common.namespace" . }}:8080
+ endpoint: http://so.onap:8080
auth: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==
#Actuator
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
index b176892192..4e0c4ad8a6 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/TaskServices.java
@@ -62,13 +62,13 @@ public class TaskServices {
public void createtAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLongLockDuration())
+ client.subscribe("InventoryCreate").lockDuration(externalTaskServiceUtils.getLockDurationMedium())
.handler(createInventory::executeExternalTask).open();
}
}
@PostConstruct
- public void auditAAIInventory() throws Exception {
+ public void deleteAAIInventory() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
externalTaskServiceUtils.createExternalTaskClient().subscribe("InventoryDelete")
.lockDuration(externalTaskServiceUtils.getLockDurationMedium())
@@ -80,7 +80,7 @@ public class TaskServices {
public void openstackInvoker() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterInvoke").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterInvoke").lockDuration(externalTaskServiceUtils.getLockDurationShort())
.handler(stackService::executeExternalTask).open();
}
}
@@ -89,7 +89,7 @@ public class TaskServices {
public void openstackPoller() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterPolling").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterPolling").lockDuration(externalTaskServiceUtils.getLockDurationMedium())
.handler(pollService::executeExternalTask).open();
}
}
@@ -98,7 +98,7 @@ public class TaskServices {
public void openstackRollback() throws Exception {
for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
ExternalTaskClient client = externalTaskServiceUtils.createExternalTaskClient();
- client.subscribe("OpenstackAdapterRollback").lockDuration(externalTaskServiceUtils.getLockDuration())
+ client.subscribe("OpenstackAdapterRollback").lockDuration(externalTaskServiceUtils.getLockDurationShort())
.handler(rollbackService::executeExternalTask).open();
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
index 3c9a4833ae..711394a95d 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/CreateInventoryTask.java
@@ -22,6 +22,8 @@
package org.onap.so.adapters.tasks.inventory;
+import java.util.HashMap;
+import java.util.Map;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
@@ -57,6 +59,7 @@ public class CreateInventoryTask extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
+ Map<String, Object> variables = new HashMap<>();
String externalTaskId = externalTask.getId();
CloudInformation cloudInformation = externalTask.getVariable("cloudInformation");
boolean success = true;
@@ -69,6 +72,7 @@ public class CreateInventoryTask extends ExternalTaskUtils {
} catch (Exception e) {
logger.error("Error during inventory of stack", e);
success = false;
+ variables.put("inventoryErrorMessage", e.getMessage());
}
mdcSetup.setElapsedTime();
if (success) {
@@ -84,7 +88,8 @@ public class CreateInventoryTask extends ExternalTaskUtils {
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, getRetrySequence().length, 10000);
} else if (retryCount != null && retryCount - 1 == 0) {
- externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
+ externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE, AAI_INVENTORY_FAILURE,
+ variables);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.error("The External Task {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java
index 08361bdbbf..aad517129f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteInventoryTask.java
@@ -22,6 +22,8 @@
package org.onap.so.adapters.tasks.inventory;
+import java.util.HashMap;
+import java.util.Map;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
@@ -56,6 +58,7 @@ public class DeleteInventoryTask extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
+ Map<String, Object> variables = new HashMap<>();
String externalTaskId = externalTask.getId();
CloudInformation cloudInformation = externalTask.getVariable("cloudInformation");
boolean success = true;
@@ -66,6 +69,7 @@ public class DeleteInventoryTask extends ExternalTaskUtils {
} catch (Exception e) {
logger.error("Error during inventory of stack", e);
success = false;
+ variables.put("inventoryErrorMessage", e.getMessage());
}
mdcSetup.setElapsedTime();
if (success) {
@@ -81,7 +85,8 @@ public class DeleteInventoryTask extends ExternalTaskUtils {
externalTaskService.handleFailure(externalTask, UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI,
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, getRetrySequence().length, 10000);
} else if (retryCount != null && retryCount - 1 == 0) {
- externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
+ externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE, AAI_INVENTORY_FAILURE,
+ variables);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.error("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
index 9ff50e8644..6a5381cf3e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java
@@ -68,7 +68,7 @@ public class PollService extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
- logger.trace("Executing External Task Poll Service");
+ logger.debug("Starting External Task Poll Service");
Map<String, Object> variables = new HashMap<>();
MutableBoolean success = new MutableBoolean();
String errorMessage = null;
@@ -103,11 +103,11 @@ public class PollService extends ExternalTaskUtils {
}
} catch (Exception e) {
logger.error("Error during External Task Poll Service", e);
- errorMessage = e.getMessage();
+ errorMessage = e.toString();
+ variables.put("openstackAdapterErrorMessage", errorMessage);
}
variables.put("OpenstackPollSuccess", success.booleanValue());
- variables.put("openstackAdapterErrorMessage", errorMessage);
if (success.isTrue()) {
externalTaskService.complete(externalTask, variables);
logger.debug("The External Task Id: {} Successful", externalTask.getId());
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
index 15e6ff581d..c25d752cc4 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java
@@ -39,7 +39,7 @@ public class RollbackService extends ExternalTaskUtils {
public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
mdcSetup.setupMDC(externalTask);
- logger.trace("Executing External Task Rollback Service");
+ logger.debug("Starting External Task Rollback Service");
Map<String, Object> variables = new HashMap<>();
boolean success = false;
boolean pollRollbackStatus = false;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
index 5196ffffda..c9fa30d949 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java
@@ -91,7 +91,7 @@ public class StackService extends ExternalTaskUtils {
Map<String, Object> variables = new HashMap<>();
mdcSetup.setupMDC(externalTask);
String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest");
- logger.debug("Executing External Task Stack Service. {}", xmlRequest);
+ logger.debug("Starting External Task Stack Service. {}", xmlRequest);
MutableBoolean success = new MutableBoolean();
MutableBoolean backout = new MutableBoolean();
String response = "";
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
index bafba3e901..1b2fdfedfa 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeApi.java
@@ -143,8 +143,10 @@ public interface HeatBridgeApi {
* @param genericVnfId AAI generic-vnf-id
* @param vfModuleId AAI vf-module-id
* @param servers Openstack Server list
+ * @throws HeatBridgeException
*/
- void buildAddVserversToAaiAction(String genericVnfId, String vfModuleId, List<Server> servers);
+ void buildAddVserversToAaiAction(String genericVnfId, String vfModuleId, List<Server> servers)
+ throws HeatBridgeException;
/**
* Query and build AAI actions for Openstack Neutron resources associated with a Compute resource to AAI's
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index baef24cbc8..6b4dbe061e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -318,8 +318,8 @@ public class HeatBridgeImpl implements HeatBridgeApi {
@Override
public void buildAddVserversToAaiAction(final String genericVnfId, final String vfModuleId,
- final List<Server> servers) {
- servers.forEach(server -> {
+ final List<Server> servers) throws HeatBridgeException {
+ for (Server server : servers) {
Vserver vserver = aaiHelper.buildVserver(server.getId(), server);
// Build vserver relationships to: image, flavor, pserver, vf-module
@@ -327,11 +327,28 @@ public class HeatBridgeImpl implements HeatBridgeApi {
aaiHelper.getVserverRelationshipList(cloudOwner, cloudRegionId, genericVnfId, vfModuleId, server));
AAIResourceUri vserverUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
.cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(vserver.getVserverId()));
+
if (resourcesClient.exists(vserverUri)) {
AAIResultWrapper existingVserver = resourcesClient.get(vserverUri);
+ AAIResourceUri vfModuleUri = AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId));
+ if (!existingVserver.hasRelationshipsTo(Types.VNFC)) {
+ AAIResultWrapper vfModule = resourcesClient.get(vfModuleUri);
+ if (vfModule.hasRelationshipsTo(Types.VNFC)) {
+ List<AAIResourceUri> vnfcUris = vfModule.getRelationships().get().getRelatedUris(Types.VNFC);
+ Optional<AAIResourceUri> foundVnfcURI = vnfcUris.stream().filter(resourceUri -> resourceUri
+ .getURIKeys().get("vnfc-name").startsWith(vserver.getVserverName())).findFirst();
+ if (foundVnfcURI.isEmpty()) {
+ throw new HeatBridgeException("Cannot Find VNFC to create edge to VServer");
+ }
+ transaction.connect(vserverUri, foundVnfcURI.get());
+ } else {
+ throw new HeatBridgeException(
+ "VF Module contains no relationships to VNFCS, cannot build edge to VServer");
+ }
+ }
+
if (!existingVserver.hasRelationshipsTo(Types.VF_MODULE)) {
- AAIResourceUri vfModuleUri = AAIUriFactory.createResourceUri(
- AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId));
transaction.connect(vserverUri, vfModuleUri);
}
if (!existingVserver.hasRelationshipsTo(Types.PSERVER)) {
@@ -342,7 +359,7 @@ public class HeatBridgeImpl implements HeatBridgeApi {
} else {
transaction.create(vserverUri, vserver);
}
- });
+ }
}
@Override
@@ -837,6 +854,10 @@ public class HeatBridgeImpl implements HeatBridgeApi {
}
}
+ protected void setAAIHelper(AaiHelper aaiHelper) {
+ this.aaiHelper = aaiHelper;
+ }
+
protected AAIDSLQueryClient getAAIDSLClient() {
if (aaiDSLClient == null) {
aaiDSLClient = new AAIDSLQueryClient();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index 8e6f8cc69b..fef7b5e6cb 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -37,6 +37,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -50,14 +51,20 @@ import org.onap.aai.domain.yang.RelationshipData;
import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.SriovVf;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.aaiclient.client.aai.AAIResourcesClient;
+import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder;
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types;
+import org.onap.so.heatbridge.HeatBridgeException;
import org.onap.so.heatbridge.constants.HeatBridgeConstants;
import org.openstack4j.model.compute.Server;
import org.openstack4j.model.network.Network;
import org.openstack4j.model.network.Port;
import org.openstack4j.model.network.Subnet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
/**
@@ -66,6 +73,14 @@ import com.google.common.base.Preconditions;
*/
public class AaiHelper {
+ private static final Logger logger = LoggerFactory.getLogger(AaiHelper.class);
+
+ private AAIResourcesClient resourcesClient;
+
+ public AaiHelper() {
+ this.resourcesClient = new AAIResourcesClient();
+ }
+
/**
* Build vserver relationship object to entities: pserver, vf-module, image, flavor
*
@@ -74,9 +89,10 @@ public class AaiHelper {
* @param genericVnfId AAI generic-vnf identifier
* @param vfModuleId AAI vf-module identifier
* @param server Openstack Server object
+ * @throws HeatBridgeException
*/
public RelationshipList getVserverRelationshipList(final String cloudOwner, final String cloudRegionId,
- final String genericVnfId, final String vfModuleId, final Server server) {
+ final String genericVnfId, final String vfModuleId, final Server server) throws HeatBridgeException {
RelationshipList relationshipList = new RelationshipList();
List<Relationship> relationships = relationshipList.getRelationship();
@@ -87,11 +103,10 @@ public class AaiHelper {
relationships.add(pserverRelationship);
}
- // vserver to generic-vnf relationship
- Relationship genericVnfRelationship = buildRelationship(
- AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId)));
- relationships.add(genericVnfRelationship);
-
+ // vserver to vnfc relationship
+ if (!StringUtils.isEmpty(server.getName())) {
+ relationships.add(createVnfRelationshiptoVserver(server.getName(), genericVnfId, vfModuleId));
+ }
// vserver to vf-module relationship
Relationship vfModuleRelationship = buildRelationship(AAIUriFactory
.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId)));
@@ -114,6 +129,27 @@ public class AaiHelper {
return relationshipList;
}
+ public Relationship createVnfRelationshiptoVserver(String vserverName, String genericVnfId, String vfModuleId)
+ throws HeatBridgeException {
+ AAIResourceUri vfModuleUri = AAIUriFactory
+ .createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId));
+ AAIResultWrapper vfModule = resourcesClient.get(vfModuleUri);
+ if (vfModule.hasRelationshipsTo(Types.VNFC)) {
+ List<AAIResourceUri> vnfcUris = vfModule.getRelationships().get().getRelatedUris(Types.VNFC);
+ Optional<AAIResourceUri> foundVnfcURI = vnfcUris.stream()
+ .filter(resourceUri -> resourceUri.getURIKeys().get("vnfc-name").startsWith(vserverName))
+ .findFirst();
+ if (!foundVnfcURI.isPresent()) {
+ throw new HeatBridgeException("Cannot Find VNFC to create edge to VServer");
+ } else {
+ return buildRelationship(foundVnfcURI.get());
+ }
+ } else {
+ throw new HeatBridgeException("VF Module contains no relationships to VNFCS, cannot build edge to VServer");
+ }
+ }
+
+
public RelationshipList getLInterfaceRelationshipList(final String pserverName, final String pIfName,
final String pfPciId) {
RelationshipList relationshipList = new RelationshipList();
@@ -378,4 +414,8 @@ public class AaiHelper {
relationship.setRelatedLink(relatedLink.build().toString());
return relationship;
}
+
+ public void setAAIResourcesClient(AAIResourcesClient client) {
+ this.resourcesClient = client;
+ }
}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index 6e653d2963..fab7df5345 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -62,6 +62,7 @@ import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -72,10 +73,15 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.PInterface;
+import org.onap.aai.domain.yang.Relationship;
+import org.onap.aai.domain.yang.RelationshipList;
import org.onap.aai.domain.yang.SriovPf;
+import org.onap.aai.domain.yang.VfModule;
+import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
import org.onap.aaiclient.client.aai.AAIDSLQueryClient;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
import org.onap.aaiclient.client.aai.AAISingleTransactionClient;
+import org.onap.aaiclient.client.aai.entities.AAIResultWrapper;
import org.onap.aaiclient.client.aai.entities.Results;
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
@@ -106,6 +112,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -151,11 +158,15 @@ public class HeatBridgeImplTest {
@Mock
private AAIDSLQueryClient dSLQueryClient;
+ @Mock
+ private AAIResourcesClient aaiResourcesClient;
+
@Spy
@InjectMocks
private HeatBridgeImpl heatbridge = new HeatBridgeImpl(resourcesClient, cloudIdentity, CLOUD_OWNER, REGION_ID,
REGION_ID, TENANT_ID, NodeType.GREENFIELD);
+
@Before
public void setUp() throws HeatBridgeException, OpenstackClientException, BulkProcessFailed {
when(resourcesClient.beginSingleTransaction()).thenReturn(transaction);
@@ -180,7 +191,30 @@ public class HeatBridgeImplTest {
@Test
- public void testUpdateVserversToAai() throws HeatBridgeException {
+ @Ignore
+ public void testUpdateVserversToAai() throws HeatBridgeException, JsonProcessingException {
+ AaiHelper helper = new AaiHelper();
+ helper.setAAIResourcesClient(resourcesClient);
+ heatbridge.setAAIHelper(helper);
+
+ VfModule module = new VfModule();
+ RelationshipList relationships = new RelationshipList();
+ List<Relationship> listRelationships = relationships.getRelationship();
+ Relationship vnfcRelationship = new Relationship();
+ vnfcRelationship.setRelationshipLabel("org.onap.relationships.inventory.Uses");
+ vnfcRelationship.setRelatedTo("vnfc");
+ vnfcRelationship.setRelatedLink("/aai/v22/network/vnfcs/vnfc/test-server1-name");
+
+ listRelationships.add(vnfcRelationship);
+
+ module.setRelationshipList(relationships);
+ AAIResultWrapper wrapper =
+ new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(module));
+
+ when(aaiResourcesClient.get(AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.network().genericVnf("test-genericVnf-id").vfModule("test-vfModule-id"))))
+ .thenReturn(wrapper);
+
// Arrange
Server server1 = mock(Server.class);
@@ -226,7 +260,29 @@ public class HeatBridgeImplTest {
}
@Test
- public void testUpdateVserversToAaiNoHypervisorName() throws HeatBridgeException {
+ @Ignore
+ public void testUpdateVserversToAaiNoHypervisorName() throws HeatBridgeException, JsonProcessingException {
+ AaiHelper aaiHelper = new AaiHelper();
+ VfModule module = new VfModule();
+ RelationshipList relationships = new RelationshipList();
+ List<Relationship> listRelationships = relationships.getRelationship();
+ Relationship vnfcRelationship = new Relationship();
+ vnfcRelationship.setRelationshipLabel("org.onap.relationships.inventory.Uses");
+ vnfcRelationship.setRelatedTo("vnfc");
+ vnfcRelationship.setRelatedLink("/aai/v22/network/vnfcs/vnfc/test-server1-name");
+
+ listRelationships.add(vnfcRelationship);
+
+ module.setRelationshipList(relationships);
+ AAIResultWrapper wrapper =
+ new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(module));
+ when(aaiResourcesClient.get(AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.network().genericVnf("test-genericVnf-id").vfModule("test-vfModule-id"))))
+ .thenReturn(wrapper);
+
+ aaiHelper.setAAIResourcesClient(aaiResourcesClient);
+ heatbridge.setAAIHelper(aaiHelper);
+
// Arrange
Server server1 = mock(Server.class);
@@ -269,8 +325,26 @@ public class HeatBridgeImplTest {
}
@Test
- public void testCreateRelationships() throws HeatBridgeException {
+ public void testCreateRelationships() throws HeatBridgeException, JsonProcessingException {
AaiHelper aaiHelper = new AaiHelper();
+ VfModule module = new VfModule();
+ RelationshipList relationships = new RelationshipList();
+ List<Relationship> listRelationships = relationships.getRelationship();
+ Relationship vnfcRelationship = new Relationship();
+ vnfcRelationship.setRelationshipLabel("org.onap.relationships.inventory.Uses");
+ vnfcRelationship.setRelatedTo("vnfc");
+ vnfcRelationship.setRelatedLink("/aai/v22/network/vnfcs/vnfc/test-server1-name");
+
+ listRelationships.add(vnfcRelationship);
+
+ module.setRelationshipList(relationships);
+ AAIResultWrapper wrapper =
+ new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(module));
+ when(aaiResourcesClient.get(AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.network().genericVnf("test-genericVnf-id").vfModule("test-vfModule-id"))))
+ .thenReturn(wrapper);
+
+ aaiHelper.setAAIResourcesClient(aaiResourcesClient);
// Arrange
Server server1 = mock(Server.class);