diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
3 files changed, 22 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollectionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollectionTest.java index cde7797ed0..207447ae35 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollectionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollectionTest.java @@ -30,6 +30,7 @@ import org.camunda.bpm.engine.delegate.BpmnError; import org.junit.Before; import org.junit.Test; import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext; @@ -43,11 +44,13 @@ public class CreateNetworkCollectionTest extends BaseTaskTest{ private L3Network network; private ServiceInstance serviceInstance; private OrchestrationContext orchestrationContext; + private CloudRegion cloudRegion; @Before public void before() { serviceInstance = setServiceInstance(); network = setL3Network(); + cloudRegion = setCloudRegion(); List<L3Network> l3NetworkList = new ArrayList<L3Network>(); l3NetworkList.add(network); @@ -92,4 +95,11 @@ public class CreateNetworkCollectionTest extends BaseTaskTest{ createNetworkCollection.connectCollectionToServiceInstance(execution); verify(aaiNetworkResources, times(1)).connectNetworkCollectionToServiceInstance(serviceInstance.getCollection(), serviceInstance); } + + @Test + public void connectInstanceGroupToCloudRegionTest() throws Exception { + doNothing().when(aaiNetworkResources).connectInstanceGroupToCloudRegion(serviceInstance.getCollection().getInstanceGroup(), cloudRegion); + createNetworkCollection.connectInstanceGroupToCloudRegion(execution); + verify(aaiNetworkResources, times(1)).connectInstanceGroupToCloudRegion(serviceInstance.getCollection().getInstanceGroup(), cloudRegion); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java index d86453b87c..db01399b82 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/aai/mapper/AAIObjectMapperTest.java @@ -280,7 +280,6 @@ public class AAIObjectMapperTest { instanceGroup.setInstanceGroupName("test-instanceGroupName"); instanceGroup.setResourceVersion("test-resourceVersion"); - ModelInfoInstanceGroup model = new ModelInfoInstanceGroup(); model.setFunction("test-function"); model.setInstanceGroupRole("SUB-INTERFACE"); @@ -288,6 +287,7 @@ public class AAIObjectMapperTest { model.setModelInvariantUUID("modelInvariantUUID-000"); model.setModelUUID("modelUUID-000"); model.setDescription("test-description"); + model.setInstanceGroupRole("SUB-INTERFACE"); instanceGroup.setModelInfoInstanceGroup(model); @@ -311,6 +311,7 @@ public class AAIObjectMapperTest { assertEquals(aaiInstanceGroup.getModelVersionId(), instanceGroup.getModelInfoInstanceGroup().getModelUUID()); assertEquals(aaiInstanceGroup.getResourceVersion(), instanceGroup.getResourceVersion()); assertEquals(aaiInstanceGroup.getInstanceGroupType(), instanceGroup.getModelInfoInstanceGroup().getType()); + assertEquals(aaiInstanceGroup.getInstanceGroupRole(), instanceGroup.getModelInfoInstanceGroup().getInstanceGroupRole()); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java index cf270c21a7..bd61424a45 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java @@ -58,6 +58,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient; +import org.onap.so.client.aai.entities.AAIEdgeLabel; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.Relationships; import org.onap.so.client.aai.entities.uri.AAIResourceUri; @@ -330,4 +331,13 @@ public class AAINetworkResourcesTest extends TestDataSetup{ verify(MOCK_aaiResourcesClient, times(1)).update(any(AAIResourceUri.class), isA(org.onap.aai.domain.yang.Subnet.class)); } + + @Test + public void connectInstanceGroupToCloudRegionTest() throws Exception { + aaiNetworkResources.connectInstanceGroupToCloudRegion(instanceGroup, cloudRegion); + verify(MOCK_aaiResourcesClient, times(1)).connect( + eq(AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroup.getId())), + eq(AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudRegion.getCloudOwner(), cloudRegion.getLcpCloudRegionId())), + eq(AAIEdgeLabel.USES)); + } } |