summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java
new file mode 100644
index 0000000000..03622db655
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/inventory/create/CreateInventoryTaskTest.java
@@ -0,0 +1,36 @@
+package org.onap.so.adapters.inventory.create;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+
+public class CreateInventoryTaskTest {
+
+ @Mock
+ ExternalTask externalTask;
+
+ @Mock
+ ExternalTaskService externalTaskService;
+
+ @InjectMocks
+ CreateInventoryTask inventoryTask;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void test_Runtime_Parse_Exception() {
+ doReturn(null).when(externalTask).getVariable("auditInventoryResult");
+ inventoryTask.executeExternalTask(externalTask, externalTaskService);
+ Mockito.verify(externalTaskService, times(1)).handleBpmnError(externalTask, "AAIInventoryFailure");
+ }
+}