summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-07-22 08:42:42 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-07-22 08:42:43 -0500
commit57361e40f7123c5a4c832169b453e22eacf563cc (patch)
tree5befd453752872fb4c2e303169c4d5bad96690dd /bpmn
parentbbdb1c45a93194db2712d8c146e263a03737f25c (diff)
Update SO to handle Async VNF operations to SDNC
Update SO to handle Async VNF operations to SDNC Issue-ID: SO-2141 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I20037306e9ce5b8df434511a46c0a3399e335c3d
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java26
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java57
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java11
15 files changed, 135 insertions, 120 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java
new file mode 100644
index 0000000000..c134f31b42
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java
@@ -0,0 +1,22 @@
+package org.onap.so.bpmn.infrastructure.sdnc.tasks;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.sdnc.beans.SDNCRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AbstractSDNCTask {
+
+ @Autowired
+ Environment env;
+
+
+ public URI buildCallbackURI(SDNCRequest sdncRequest) {
+ UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
+ .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
+ return builder.build();
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
index e4dd35503e..b85e33144f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
@@ -52,7 +50,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCActivateTasks {
+public class SDNCActivateTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -77,9 +75,9 @@ public class SDNCActivateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
Customer customer = gBBInput.getCustomer();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.activateVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.activateVnf(vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -127,11 +125,8 @@ public class SDNCActivateTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.activateVfModule(vfModule, vnf,
- serviceInstance, customer, cloudRegion, requestContext, uri);
+ serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index c100cd6cee..ab2647a68d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -55,7 +53,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCAssignTasks {
+public class SDNCAssignTasks extends AbstractSDNCTask {
private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class);
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -100,9 +98,11 @@ public class SDNCAssignTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- GenericResourceApiVnfOperationInformation req = sdncVnfResources.assignVnf(vnf, serviceInstance, customer,
- cloudRegion, requestContext, Boolean.TRUE.equals(vnf.isCallHoming()));
SDNCRequest sdncRequest = new SDNCRequest();
+
+ GenericResourceApiVnfOperationInformation req =
+ sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext,
+ Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -128,11 +128,9 @@ public class SDNCAssignTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
- GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.assignVfModule(vfModule,
- volumeGroup, vnf, serviceInstance, customer, cloudRegion, requestContext, uri);
+ GenericResourceApiVfModuleOperationInformation req =
+ sdncVfModuleResources.assignVfModule(vfModule, volumeGroup, vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
index acf48acdda..c5ebc5e447 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
@@ -20,8 +20,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -49,7 +47,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCChangeAssignTasks {
+public class SDNCChangeAssignTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
private SDNCNetworkResources sdncNetworkResources;
@@ -88,9 +86,10 @@ public class SDNCChangeAssignTasks {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- GenericResourceApiVnfOperationInformation req = sdncVnfResources.changeModelVnf(genericVnf, serviceInstance,
- gBBInput.getCustomer(), gBBInput.getCloudRegion(), gBBInput.getRequestContext());
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req =
+ sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, gBBInput.getCustomer(),
+ gBBInput.getCloudRegion(), gBBInput.getRequestContext(), buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -127,11 +126,8 @@ public class SDNCChangeAssignTasks {
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
Customer customer = gBBInput.getCustomer();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.changeAssignVfModule(vfModule,
- vnf, serviceInstance, customer, cloudRegion, requestContext, uri);
+ vnf, serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
index 3fc25196e1..3c42f76d73 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -53,7 +51,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCDeactivateTasks {
+public class SDNCDeactivateTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -82,11 +80,8 @@ public class SDNCDeactivateTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.deactivateVfModule(vfModule, vnf,
- serviceInstance, customer, cloudRegion, requestContext, uri);
+ serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -111,9 +106,9 @@ public class SDNCDeactivateTasks {
vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
Customer customer = gBBInput.getCustomer();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.deactivateVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.deactivateVnf(vnf, serviceInstance,
+ customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
index 4721bf56f1..e3c9785ab2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -53,7 +51,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCUnassignTasks {
+public class SDNCUnassignTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -98,11 +96,8 @@ public class SDNCUnassignTasks {
RequestContext requestContext = gBBInput.getRequestContext();
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
- GenericResourceApiVfModuleOperationInformation req =
- sdncVfModuleResources.unassignVfModule(vfModule, vnf, serviceInstance, requestContext, uri);
+ GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.unassignVfModule(vfModule, vnf,
+ serviceInstance, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -120,9 +115,9 @@ public class SDNCUnassignTasks {
RequestContext requestContext = gBBInput.getRequestContext();
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.unassignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.unassignVnf(vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
index 0e32955eed..12aae1e6a6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
@@ -22,6 +22,7 @@
package org.onap.so.client.orchestration;
+import java.net.URI;
import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -50,47 +51,48 @@ public class SDNCVnfResources {
private SDNCClient sdncClient;
public GenericResourceApiVnfOperationInformation assignVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing,
+ URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, homing);
+ cloudRegion, requestContext, homing, callbackURI);
}
public GenericResourceApiVnfOperationInformation activateVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ACTIVATE,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation deactivateVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation unassignVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation deleteVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation changeModelVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public String queryVnf(GenericVnf vnf) throws MapperException, BadResponseException {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
index e39e202aa3..bef4ec3465 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
@@ -20,6 +20,7 @@
package org.onap.so.client.sdnc.mapper;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -56,7 +57,8 @@ public class VnfTopologyOperationRequestMapper {
public GenericResourceApiVnfOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction,
GenericResourceApiRequestActionEnumeration requestAction, GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing,
+ URI callbackUrl) {
String sdncReqId = UUID.randomUUID().toString();
String msoRequestId = UUID.randomUUID().toString();
if (requestContext != null && requestContext.getMsoRequestId() != null) {
@@ -64,7 +66,7 @@ public class VnfTopologyOperationRequestMapper {
}
GenericResourceApiVnfOperationInformation req = new GenericResourceApiVnfOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader =
- generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
+ generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUrl.toString());
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper
.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, requestAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation =
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
index ffd4f74b63..510dc47649 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
@@ -94,11 +94,11 @@ public class SDNCActivateTaskTest extends BaseTaskTest {
@Test
public void activateVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncActivateTasks.activateVnf(execution);
- verify(sdncVnfResources, times(1)).activateVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).activateVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -106,8 +106,8 @@ public class SDNCActivateTaskTest extends BaseTaskTest {
@Test
public void activateVnfTestException() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).activateVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).activateVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncActivateTasks.activateVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
index 982868dcbc..b72766c386 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
@@ -113,12 +113,12 @@ public class SDNCAssignTasksTest extends BaseTaskTest {
@Test
public void assignVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext, false);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
execution.setVariable("generalBuildingBlock", gBBInput);
sdncAssignTasks.assignVnf(execution);
- verify(sdncVnfResources, times(1)).assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext,
- false);
+ verify(sdncVnfResources, times(1)).assignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion),
+ eq(requestContext), eq(false), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -126,8 +126,8 @@ public class SDNCAssignTasksTest extends BaseTaskTest {
@Test
public void assignVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).assignVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ doThrow(RuntimeException.class).when(sdncVnfResources).assignVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
sdncAssignTasks.assignVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
index 8c25bea801..96ff01f78b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
@@ -80,11 +80,11 @@ public class SDNCChangeAssignTasksTest extends BaseTaskTest {
@Test
public void changeModelVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).changeModelVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).changeModelVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeModelVnf(execution);
- verify(sdncVnfResources, times(1)).changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).changeModelVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -92,8 +92,8 @@ public class SDNCChangeAssignTasksTest extends BaseTaskTest {
@Test
public void changeModelVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).changeModelVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).changeModelVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeModelVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
index d8a1b0182e..3714f9d9a9 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
@@ -107,19 +107,19 @@ public class SDNCDeactivateTaskTest extends BaseTaskTest {
@Test
public void deactivateVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).deactivateVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).deactivateVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncDeactivateTasks.deactivateVnf(execution);
- verify(sdncVnfResources, times(1)).deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).deactivateVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@Test
public void deactivateVnfExceptionTest() throws Exception {
- doThrow(RuntimeException.class).when(sdncVnfResources).deactivateVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).deactivateVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
expectedException.expect(BpmnError.class);
sdncDeactivateTasks.deactivateVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
index b29d15c830..98f6bfab9c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
@@ -125,11 +125,11 @@ public class SDNCUnassignTasksTest extends BaseTaskTest {
@Test
public void unassignVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVnf(execution);
- verify(sdncVnfResources, times(1)).unassignVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).unassignVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -137,8 +137,8 @@ public class SDNCUnassignTasksTest extends BaseTaskTest {
@Test
public void unassignVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).unassignVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).unassignVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
index 4c0e2b873f..0ccf056ddc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
@@ -28,6 +28,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import java.net.URI;
+import java.net.URISyntaxException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,6 +68,7 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
private CloudRegion cloudRegion;
private RequestContext requestContext;
private GenericResourceApiVnfOperationInformation sdncReq;
+ private URI testURI;
@Before
public void before() {
@@ -75,6 +78,11 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
cloudRegion = buildCloudRegion();
requestContext = buildRequestContext();
sdncReq = new GenericResourceApiVnfOperationInformation();
+ try {
+ testURI = new URI("http://localhost:9800");
+ } catch (URISyntaxException e) {
+
+ }
}
@Test
@@ -82,12 +90,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, false);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, false, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -95,12 +103,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.activateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.activateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -108,12 +116,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deleteVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deleteVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -137,11 +145,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
- verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION,
- SDNCSvcAction.CHANGE_ASSIGN, GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, genericVnf,
- serviceInstance, customer, cloudRegion, requestContext, false);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
+ verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
+ eq(SDNCSvcAction.CHANGE_ASSIGN), eq(GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE),
+ eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false),
+ any(URI.class));
}
@Test
@@ -150,12 +159,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
eq(SDNCSvcAction.DEACTIVATE), isA(GenericResourceApiRequestActionEnumeration.class),
any(GenericVnf.class), any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class),
- any(RequestContext.class), anyBoolean());
+ any(RequestContext.class), anyBoolean(), any(URI.class));
}
@@ -166,8 +175,8 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
}
@Test
@@ -176,12 +185,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
eq(SDNCSvcAction.UNASSIGN), isA(GenericResourceApiRequestActionEnumeration.class),
any(GenericVnf.class), any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class),
- any(RequestContext.class), anyBoolean());
+ any(RequestContext.class), anyBoolean(), any(URI.class));
}
@Test
@@ -191,7 +200,7 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
index cecf34ea10..00836176f0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
@@ -23,15 +23,18 @@ package org.onap.so.client.sdnc.mapper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Map;
import java.util.List;
+import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -45,8 +48,6 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
@RunWith(MockitoJUnitRunner.class)
public class VnfTopologyOperationRequestMapperTest {
@@ -127,11 +128,11 @@ public class VnfTopologyOperationRequestMapperTest {
GenericResourceApiVnfOperationInformation vnfOpInformation =
mapper.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, true);
+ cloudRegion, requestContext, true, new URI("http://localhost:8080"));
GenericResourceApiVnfOperationInformation vnfOpInformationNullReqContext =
mapper.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, null, true);
+ cloudRegion, null, true, new URI("http://localhost:8080"));
assertNull(vnfOpInformation.getServiceInformation().getOnapModelInformation().getModelCustomizationUuid());
assertEquals("vnfModelCustomizationUUID",