diff options
author | biniek <lukasz.biniek@nokia.com> | 2018-04-05 11:09:10 +0200 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-04-06 14:11:34 +0000 |
commit | cafd0137bce8c5f5344a2b8d249904503e0c1af3 (patch) | |
tree | b3a57fc97960e3c2f2e9e94edef2ac518db37503 /bpmn/MSOInfrastructureBPMN/src/test/java/org | |
parent | f58931869ec5bc1e3d9b9697618eec6e8db33dc4 (diff) |
Added creating WorkflowException in pnf-pnp
Change-Id: I3cd5932913e58983c85e63c84c5136d04b0489e8
Issue-ID: SO-506
Signed-off-by: biniek <lukasz.biniek@nokia.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test/java/org')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java | 11 |
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 |