summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/test
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-04-10 08:37:29 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-10 08:37:29 +0000
commitc89d0d7d347c96bcfd84971214ab2e4cfe4546ae (patch)
treef52f066fbd9f1c8a8be4b71b7e9dcfe96fd0faea /bpmn/MSOInfrastructureBPMN/src/test
parent5f5b1cefb7f226a637b272ca39d0f05daebdb524 (diff)
parentcafd0137bce8c5f5344a2b8d249904503e0c1af3 (diff)
Merge "Added creating WorkflowException in pnf-pnp"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
index d98a395838..75a7450434 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
@@ -21,10 +21,11 @@
package org.openecomp.mso.bpmn.infrastructure.pnf.delegate;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.DEFAULT_IP;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITHOUT_ENTRY;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_AND_IP;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_NO_IP;
@@ -38,6 +39,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
+import org.openecomp.mso.bpmn.core.WorkflowException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@@ -60,8 +62,7 @@ public class CheckAaiForCorrelationIdDelegateTest {
when(execution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue");
// when, then
assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class);
- // todo: uncomment line below after fixing Execution -> DelecateExecution in groovy scripts
-// verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
+ verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
}
@Test
@@ -118,12 +119,14 @@ public class CheckAaiForCorrelationIdDelegateTest {
private CheckAaiForCorrelationIdDelegate delegate;
@Test
- public void shouldThrowExceptionWhenSSADFDSADSFDS() throws Exception {
+ public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() throws Exception {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY_NO_IP);
+ when(execution.getVariable("testProcessKey")).thenReturn("testProcessKey");
// when, then
assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class);
+ verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
}
}
} \ No newline at end of file