summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-11-09 00:42:24 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-09 00:42:24 +0000
commitb1ddae75b87e7591393054bbf7d362d5d495fe23 (patch)
tree8278d2d994057c5691394f8d24b9c21022076407 /adapters/mso-openstack-adapters/src/test
parent6a96e6067400fbc0b4b64e4cbadeb9a74ed72eb9 (diff)
parentec99422b06b4c907293b293880243b77970368d0 (diff)
Merge "do not throw an exception when no relationship exists"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java5
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java6
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java11
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java6
4 files changed, 20 insertions, 8 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
index 8d5ab8234e..60826705fd 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java
@@ -14,6 +14,7 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.adapters.tasks.orchestration.PollService;
+import org.onap.so.adapters.vnf.VnfAdapterUtils;
import org.onap.so.logging.tasks.AuditMDCSetup;
import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.utils.MsoHeatUtils;
@@ -34,6 +35,9 @@ public class PollServiceTest {
private MsoHeatUtils msoHeatUtils;
@Mock
+ private VnfAdapterUtils vnfAdapterUtils;
+
+ @Mock
private AuditMDCSetup mdcSetup;
@InjectMocks
@@ -44,6 +48,7 @@ public class PollServiceTest {
String xmlString =
new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "/vnfAdapterTaskRequestCreate.xml")));
+ Mockito.when(vnfAdapterUtils.isMulticloudMode(Mockito.any(), Mockito.any())).thenReturn(false);
Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString);
Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(false);
Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123");
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java
index 1f68106f78..3a82dd5b72 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java
@@ -18,6 +18,7 @@ import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.adapters.tasks.orchestration.RollbackService;
import org.onap.so.adapters.vnf.MsoVnfAdapterImpl;
+import org.onap.so.adapters.vnf.VnfAdapterUtils;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.entity.MsoRequest;
import org.onap.so.logging.tasks.AuditMDCSetup;
@@ -41,6 +42,9 @@ public class RollbackServiceTest {
private MsoVnfAdapterImpl vnfAdapterImpl;
@Mock
+ private VnfAdapterUtils vnfAdapterUtils;
+
+ @Mock
private MsoHeatUtils msoHeatUtils;
@Mock
@@ -65,6 +69,8 @@ public class RollbackServiceTest {
Stack stack = new Stack();
stack.setId("heatId");
+
+ Mockito.when(vnfAdapterUtils.isMulticloudMode(Mockito.any(), Mockito.any())).thenReturn(false);
Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(payload);
Mockito.doNothing().when(vnfAdapterImpl).deleteVfModule(Mockito.any(), Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java
index cc2dfa213e..afe7e17855 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java
@@ -7,7 +7,6 @@ import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-import javax.xml.ws.Holder;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.junit.Test;
@@ -16,15 +15,13 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.adapters.tasks.orchestration.StackService;
import org.onap.so.adapters.vnf.MsoVnfAdapterImpl;
-import org.onap.so.entity.MsoRequest;
+import org.onap.so.adapters.vnf.VnfAdapterUtils;
+import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.logging.tasks.AuditMDCSetup;
-import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.exceptions.MsoException;
import org.onap.so.openstack.utils.MsoHeatUtils;
import com.woorea.openstack.heat.model.Stack;
-import org.onap.so.adapters.vnf.exceptions.VnfException;
@RunWith(MockitoJUnitRunner.class)
public class StackServiceTest {
@@ -41,6 +38,9 @@ public class StackServiceTest {
private MsoVnfAdapterImpl vnfAdapterImpl;
@Mock
+ private VnfAdapterUtils vnfAdapterUtils;
+
+ @Mock
private MsoHeatUtils msoHeatUtils;
@Mock
@@ -64,6 +64,7 @@ public class StackServiceTest {
Stack stack = new Stack();
stack.setId("heatId");
+ Mockito.when(vnfAdapterUtils.isMulticloudMode(Mockito.any(), Mockito.any())).thenReturn(false);
Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(payload);
Mockito.doNothing().when(vnfAdapterImpl).createVfModule(Mockito.any(), Mockito.any(), Mockito.any(),
Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(),
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 fab7df5345..a18904f8f4 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
@@ -371,15 +371,15 @@ public class HeatBridgeImplTest {
org.onap.aai.domain.yang.RelationshipList relList = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID,
"test-genericVnf-id", "test-vfModule-id", server1);
- assertEquals(3, relList.getRelationship().size());
+ assertEquals(2, relList.getRelationship().size());
org.onap.aai.domain.yang.RelationshipList relList2 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER,
REGION_ID, "test-genericVnf-id", "test-vfModule-id", server2);
- assertEquals(2, relList2.getRelationship().size());
+ assertEquals(1, relList2.getRelationship().size());
org.onap.aai.domain.yang.RelationshipList relList3 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER,
REGION_ID, "test-genericVnf-id", "test-vfModule-id", server3);
- assertEquals(2, relList3.getRelationship().size());
+ assertEquals(1, relList3.getRelationship().size());
}