diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/CallActivityHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/CallActivityHandler.java index 37fb5b97..57961067 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/CallActivityHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/CallActivityHandler.java @@ -38,7 +38,23 @@ public class CallActivityHandler { private Consumer processIdConsumer; + public CallActivityHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new CallActivityElement(); + element.id = elementId; + } + public CallActivityHandler(CallActivityElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; } diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/CustomMultiInstanceHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/CustomMultiInstanceHandler.java index 7195dfba..6fe74a7c 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/CustomMultiInstanceHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/CustomMultiInstanceHandler.java @@ -20,7 +20,23 @@ public class CustomMultiInstanceHandler { private Boolean expectedSequential; + public CustomMultiInstanceHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new MultiInstanceElement(); + element.id = elementId; + } + public CustomMultiInstanceHandler(MultiInstanceElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; } diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/JobHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/JobHandler.java index 803704d3..611829a5 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/JobHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/JobHandler.java @@ -35,7 +35,23 @@ public class JobHandler { private Consumer retriesConsumer; private Consumer typeConsumer; + public JobHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new JobElement(); + element.id = elementId; + } + public JobHandler(JobElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; } diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/MessageEventHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/MessageEventHandler.java index 1c9fd17e..34b4d418 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/MessageEventHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/MessageEventHandler.java @@ -29,7 +29,25 @@ public class MessageEventHandler { private Consumer correlationKeyConsumer; private Consumer messageNameConsumer; + public MessageEventHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new MessageEventElement(); + element.id = elementId; + + correlate(); + } + public MessageEventHandler(MessageEventElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; correlate(); diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/SignalEventHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/SignalEventHandler.java index 9e8b6547..bd8dd6f4 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/SignalEventHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/SignalEventHandler.java @@ -22,7 +22,25 @@ public class SignalEventHandler { private Consumer signalNameConsumer; + public SignalEventHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new SignalEventElement(); + element.id = elementId; + + broadcast(); + } + public SignalEventHandler(SignalEventElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; broadcast(); diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/TestCaseInstance.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/TestCaseInstance.java index b217130d..71530996 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/TestCaseInstance.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/TestCaseInstance.java @@ -1,5 +1,6 @@ package org.camunda.community.bpmndt.api; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -7,6 +8,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.function.Predicate; +import java.util.stream.Collectors; import org.camunda.community.bpmndt.api.TestCaseInstanceMemo.JobMemo; import org.camunda.community.bpmndt.api.TestCaseInstanceMemo.MessageSubscriptionMemo; @@ -21,7 +23,9 @@ import io.camunda.zeebe.protocol.record.ValueType; import io.camunda.zeebe.protocol.record.intent.IncidentIntent; import io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent; +import io.camunda.zeebe.protocol.record.value.BpmnElementType; import io.camunda.zeebe.protocol.record.value.IncidentRecordValue; +import io.camunda.zeebe.protocol.record.value.ProcessInstanceRecordValue; /** * Link between a test case and its execution, utilizing a process instance that was instantiated by a {@link TestCaseExecutor} and handlers (e.g. @@ -118,7 +122,7 @@ public void hasPassed(long processInstanceKey, String elementId) { }); if (!hasPassed) { - var message = withIncidents("expected process instance %d to have passed BPMN element %s, but has not", processInstanceKey); + var message = withDetails("expected process instance %d to have passed BPMN element %s, but has not", processInstanceKey); throw new AssertionError(String.format(message, processInstanceKey, elementId)); } } @@ -135,7 +139,7 @@ public void hasPassedMultiInstance(long processInstanceKey, String elementId) { }); if (!hasPassed) { - var message = withIncidents("expected process instance %d to have passed BPMN multi instance element %s, but has not", processInstanceKey); + var message = withDetails("expected process instance %d to have passed BPMN multi instance element %s, but has not", processInstanceKey); throw new AssertionError(String.format(message, processInstanceKey, elementId)); } } @@ -152,7 +156,7 @@ public void hasTerminated(long processInstanceKey, String bpmnElementId) { }); if (!hasTerminated) { - var message = withIncidents("expected process instance %d to have terminated BPMN element %s, but has not", processInstanceKey); + var message = withDetails("expected process instance %d to have terminated BPMN element %s, but has not", processInstanceKey); throw new AssertionError(String.format(message, processInstanceKey, bpmnElementId)); } } @@ -168,7 +172,7 @@ public void isCompleted(long processInstanceKey) { }); if (!isCompleted) { - String message = withIncidents("expected process instance %d to be completed, but was not", processInstanceKey); + String message = withDetails("expected process instance %d to be completed, but was not", processInstanceKey); throw new AssertionError(String.format(message, processInstanceKey)); } } @@ -208,13 +212,13 @@ ProcessInstanceMemo getCalledProcessInstance(long processInstanceKey, String cal return select(memo -> { var processInstance = memo.getProcessInstance(processInstanceKey); if (processInstance == null) { - var message = "process instance %d could not be found"; + var message = withDetails("process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, processInstanceKey)); } var callActivity = processInstance.getElement(callActivityId); if (callActivity == null) { - var message = "call activity %s of process instance %d could not be found"; + var message = withDetails("call activity %s of process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, callActivityId, processInstanceKey)); } @@ -222,7 +226,7 @@ ProcessInstanceMemo getCalledProcessInstance(long processInstanceKey, String cal .filter(pi -> pi.parentElementInstanceKey == callActivity.key) .findFirst() .orElseThrow(() -> { - var message = "call activity %s of process instance %d has not called a process"; + var message = withDetails("call activity %s of process instance %d has not called a process", processInstanceKey); return new IllegalStateException(String.format(message, callActivityId, processInstanceKey)); }); }); @@ -232,13 +236,13 @@ JobMemo getJob(long processInstanceKey, String elementId) { return select(memo -> { var processInstance = memo.getProcessInstance(processInstanceKey); if (processInstance == null) { - var message = "process instance %d could not be found"; + var message = withDetails("process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, processInstanceKey)); } var job = processInstance.getJob(elementId); if (job == null) { - var message = "job %s could not be found"; + var message = withDetails("job %s could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, elementId)); } @@ -250,13 +254,13 @@ MessageSubscriptionMemo getMessageSubscription(long processInstanceKey, String e return select(memo -> { var processInstance = memo.getProcessInstance(processInstanceKey); if (processInstance == null) { - var message = "process instance %d could not be found"; + var message = withDetails("process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, processInstanceKey)); } var messageSubscription = processInstance.getMessageSubscription(elementId); if (messageSubscription == null) { - var message = "message subscription %s could not be found"; + var message = withDetails("message subscription %s could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, elementId)); } @@ -268,7 +272,7 @@ SignalSubscriptionMemo getSignalSubscription(long processInstanceKey, String ele return select(memo -> { var processInstance = memo.getProcessInstance(processInstanceKey); if (processInstance == null) { - var message = "process instance %d could not be found"; + var message = withDetails("process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, processInstanceKey)); } @@ -276,7 +280,7 @@ SignalSubscriptionMemo getSignalSubscription(long processInstanceKey, String ele .filter(signalSubscription -> signalSubscription.catchEventId.equals(elementId)) .findFirst() .orElseThrow(() -> { - var message = "element %s of process instance %d has no signal subscription"; + var message = withDetails("element %s of process instance %d has no signal subscription", processInstanceKey); return new IllegalStateException(String.format(message, elementId, processInstanceKey)); }); }); @@ -286,13 +290,13 @@ TimerMemo getTimer(long processInstanceKey, String elementId) { return select(memo -> { var processInstance = memo.getProcessInstance(processInstanceKey); if (processInstance == null) { - var message = "process instance %d could not be found"; + var message = withDetails("process instance %d could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, processInstanceKey)); } var timer = processInstance.getTimer(elementId); if (timer == null) { - var message = "timer %s could not be found"; + var message = withDetails("timer %s could not be found", processInstanceKey); throw new IllegalStateException(String.format(message, elementId)); } @@ -391,6 +395,10 @@ private boolean selectAndTest(Predicate predicate) { return selectAndTestTask == null; } + private String withDetails(String message, long processInstanceKey) { + return withIncidents(withWaitStates(message, processInstanceKey), processInstanceKey); + } + private String withIncidents(String message, long processInstanceKey) { var incidents = new LinkedList(); @@ -423,6 +431,44 @@ private String withIncidents(String message, long processInstanceKey) { return messageBuilder.toString(); } + private String withWaitStates(String message, long processInstanceKey) { + var elements = new LinkedHashMap(); + + var recordStream = RecordStream.of(engine.getRecordStreamSource()); + for (Record record : recordStream.records()) { + if (record.getValueType() != ValueType.PROCESS_INSTANCE) { + continue; + } + + var recordValue = (ProcessInstanceRecordValue) record.getValue(); + if (recordValue.getBpmnElementType() == BpmnElementType.PROCESS || recordValue.getProcessInstanceKey() != processInstanceKey) { + continue; + } + + var state = (ProcessInstanceIntent) record.getIntent(); + + elements.put(recordValue.getElementId(), state); + } + + var waitStates = elements.keySet().stream() + .filter(k -> elements.get(k) == ProcessInstanceIntent.ELEMENT_ACTIVATED) + .collect(Collectors.toList()); + + if (waitStates.isEmpty()) { + return message; + } + + var messageBuilder = new StringBuilder(message); + messageBuilder.append("\nfound active elements:"); + + for (String waitState : waitStates) { + messageBuilder.append("\n - "); + messageBuilder.append(waitState); + } + + return messageBuilder.toString(); + } + private static class SelectTask { final Function selector; diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/TimerEventHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/TimerEventHandler.java index 2d8ef1fc..5193058b 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/TimerEventHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/TimerEventHandler.java @@ -23,7 +23,23 @@ public class TimerEventHandler { private Consumer timeDateConsumer; private Consumer timeDurationConsumer; + public TimerEventHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new TimerEventElement(); + element.id = elementId; + } + public TimerEventHandler(TimerEventElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; } diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/api/UserTaskHandler.java b/impl-8/src/main/java/org/camunda/community/bpmndt/api/UserTaskHandler.java index 918f8148..4ac6f7dd 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/api/UserTaskHandler.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/api/UserTaskHandler.java @@ -44,7 +44,25 @@ public class UserTaskHandler { private Consumer followUpDateConsumer; private Consumer formKeyConsumer; + public UserTaskHandler(String elementId) { + if (elementId == null) { + throw new IllegalArgumentException("element ID is null"); + } + + element = new UserTaskElement(); + element.id = elementId; + + complete(); + } + public UserTaskHandler(UserTaskElement element) { + if (element == null) { + throw new IllegalArgumentException("element is null"); + } + if (element.id == null) { + throw new IllegalArgumentException("element ID is null"); + } + this.element = element; complete(); diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceScopeStrategy.java b/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceScopeStrategy.java index aa1fed23..81f6e574 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceScopeStrategy.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceScopeStrategy.java @@ -8,12 +8,15 @@ import org.camunda.community.bpmndt.api.TestCaseInstanceElement.MultiInstanceElement; import org.camunda.community.bpmndt.model.BpmnElement; import org.camunda.community.bpmndt.model.BpmnElementScope; +import org.camunda.community.bpmndt.model.BpmnElementType; import com.squareup.javapoet.CodeBlock; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec.Builder; +import io.camunda.zeebe.model.bpmn.instance.FlowNode; + public class CustomMultiInstanceScopeStrategy implements GeneratorStrategy { private final BpmnElementScope scope; @@ -52,7 +55,7 @@ public void applyHandler(MethodSpec.Builder methodBuilder) { @Override public BpmnElement getElement() { - throw new UnsupportedOperationException(); + return new BpmnElementWrapper(scope); } @Override @@ -100,4 +103,111 @@ public CodeBlock initHandlerStatement() { public void isWaitingAt(MethodSpec.Builder methodBuilder) { // nothing to do here } + + /** + * Wrapper class to use an {@link BpmnElementScope} as BPMN element. + */ + private static class BpmnElementWrapper implements BpmnElement { + + private final BpmnElementScope scope; + + private BpmnElementWrapper(BpmnElementScope scope) { + this.scope = scope; + } + + @Override + public FlowNode getFlowNode() { + return scope.getFlowNode(); + } + + @Override + public T getFlowNode(Class flowNodeType) { + return flowNodeType.cast(scope.getFlowNode()); + } + + @Override + public String getId() { + return scope.getId(); + } + + @Override + public String getName() { + return scope.getName(); + } + + @Override + public int getNestingLevel() { + return scope.getNestingLevel(); + } + + @Override + public BpmnElement getNext() { + throw new UnsupportedOperationException(); + } + + @Override + public BpmnElementScope getParent() { + return scope.getParent(); + } + + @Override + public BpmnElement getPrevious() { + throw new UnsupportedOperationException(); + } + + @Override + public BpmnElementType getType() { + return BpmnElementType.SCOPE; + } + + @Override + public String getTypeName() { + return scope.getTypeName(); + } + + @Override + public boolean hasMultiInstanceParent() { + return scope.hasParent() && scope.getParent().isMultiInstance(); + } + + @Override + public boolean hasNext() { + return false; + } + + @Override + public boolean hasParent() { + return scope.hasParent(); + } + + @Override + public boolean hasPrevious() { + return false; + } + + @Override + public boolean hasPrevious(BpmnElementType type) { + return false; + } + + @Override + public boolean isAttachedTo(BpmnElement element) { + return false; + } + + @Override + public boolean isMultiInstance() { + return scope.isMultiInstance(); + } + + @Override + public boolean isMultiInstanceSequential() { + return scope.isMultiInstanceSequential(); + } + + @Override + public boolean isProcessStart() { + return false; + } + } } diff --git a/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceStrategy.java b/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceStrategy.java index ce0501df..f47bc013 100644 --- a/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceStrategy.java +++ b/impl-8/src/main/java/org/camunda/community/bpmndt/strategy/CustomMultiInstanceStrategy.java @@ -32,6 +32,6 @@ public void initHandlerElement(MethodSpec.Builder methodBuilder) { methodBuilder.addStatement("$T $LElement = new $T()", MultiInstanceElement.class, literal, MultiInstanceElement.class); methodBuilder.addStatement("$LElement.id = $S", literal, element.getId()); - methodBuilder.addStatement("$LElement.sequential = $L", element.isMultiInstanceSequential()); + methodBuilder.addStatement("$LElement.sequential = $L", literal, element.isMultiInstanceSequential()); } } diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityErrorTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityErrorTest.java index 4a02bd9f..ea84877a 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityErrorTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityErrorTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.CallActivityElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,10 +25,7 @@ class CallActivityErrorTest { @BeforeEach void setUp() { - var element = new CallActivityElement(); - element.id = "callActivity"; - - handler = new CallActivityHandler(element); + handler = new CallActivityHandler("callActivity"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityEscalationTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityEscalationTest.java index 78fef443..6c659861 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityEscalationTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityEscalationTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.CallActivityElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,10 +25,7 @@ class CallActivityEscalationTest { @BeforeEach void setUp() { - var element = new CallActivityElement(); - element.id = "callActivity"; - - handler = new CallActivityHandler(element); + handler = new CallActivityHandler("callActivity"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityMessageTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityMessageTest.java index 79c072a2..e94585ed 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityMessageTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityMessageTest.java @@ -4,8 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.CallActivityElement; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.MessageEventElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,16 +26,8 @@ class CallActivityMessageTest { @BeforeEach void setUp() { - var element = new CallActivityElement(); - element.id = "callActivity"; - - handler = new CallActivityHandler(element); - - var boundaryEventElement = new MessageEventElement(); - boundaryEventElement.id = "messageBoundaryEvent"; - boundaryEventElement.messageName = "advancedMessage"; - - boundaryEventHandler = new MessageEventHandler(boundaryEventElement); + handler = new CallActivityHandler("callActivity"); + boundaryEventHandler = new MessageEventHandler("messageBoundaryEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivitySignalTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivitySignalTest.java index 0ac005d5..c0bdb1a2 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivitySignalTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivitySignalTest.java @@ -4,8 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.CallActivityElement; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.SignalEventElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,16 +26,8 @@ class CallActivitySignalTest { @BeforeEach void setUp() { - var element = new CallActivityElement(); - element.id = "callActivity"; - - handler = new CallActivityHandler(element); - - var boundaryEventElement = new SignalEventElement(); - boundaryEventElement.id = "signalBoundaryEvent"; - boundaryEventElement.signalName = "advancedSignal"; - - boundaryEventHandler = new SignalEventHandler(boundaryEventElement); + handler = new CallActivityHandler("callActivity"); + boundaryEventHandler = new SignalEventHandler("signalBoundaryEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityTimerTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityTimerTest.java index 46d8efc4..e3184461 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityTimerTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/CallActivityTimerTest.java @@ -4,8 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.CallActivityElement; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.TimerEventElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,15 +26,8 @@ class CallActivityTimerTest { @BeforeEach void setUp() { - var element = new CallActivityElement(); - element.id = "callActivity"; - - handler = new CallActivityHandler(element); - - var boundaryEventElement = new TimerEventElement(); - boundaryEventElement.id = "timerBoundaryEvent"; - - boundaryEventHandler = new TimerEventHandler(boundaryEventElement); + handler = new CallActivityHandler("callActivity"); + boundaryEventHandler = new TimerEventHandler("timerBoundaryEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageEndEventTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageEndEventTest.java index a75c430d..50a4df9e 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageEndEventTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageEndEventTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,11 +27,7 @@ class MessageEndEventTest { @BeforeEach void setUp() { - var element = new JobElement(); - element.id = "messageEndEvent"; - element.type = "messageEndEventType"; - - handler = new JobHandler(element); + handler = new JobHandler("messageEndEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageThrowEventTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageThrowEventTest.java index 9234770c..29661cef 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageThrowEventTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MessageThrowEventTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,11 +27,7 @@ class MessageThrowEventTest { @BeforeEach void setUp() { - JobElement element = new JobElement(); - element.id = "messageThrowEvent"; - element.type = "messageThrowEventType"; - - handler = new JobHandler(element); + handler = new JobHandler("messageThrowEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeNestedTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeNestedTest.java new file mode 100644 index 00000000..0a27b57e --- /dev/null +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeNestedTest.java @@ -0,0 +1,95 @@ +package org.camunda.community.bpmndt.api; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.List; + +import org.camunda.community.bpmndt.test.TestPaths; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.camunda.zeebe.process.test.api.ZeebeTestEngine; +import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert; +import io.camunda.zeebe.process.test.extension.ZeebeProcessTest; + +@ZeebeProcessTest +class MultiInstanceScopeNestedTest { + + @RegisterExtension + TestCase tc = new TestCase(); + + ZeebeTestEngine engine; + + private CustomMultiInstanceHandler handler; + + @BeforeEach + public void setUp() { + handler = new CustomMultiInstanceHandler("subProcess"); + } + + @Test + void testExecute() { + var elements = List.of(1, 2, 3); + var nestedElements = List.of(4, 5); + + handler.execute((testCaseInstance, processInstanceKey) -> { + var nestedSubProcessHandler = new CustomMultiInstanceHandler("nestedSubProcess"); + + nestedSubProcessHandler.execute((__, ___) -> { + var userTaskHandler = new UserTaskHandler("userTask"); + + for (int i = 0; i < nestedElements.size(); i++) { + testCaseInstance.apply(processInstanceKey, userTaskHandler); + } + }); + + for (int i = 0; i < elements.size(); i++) { + testCaseInstance.apply(processInstanceKey, nestedSubProcessHandler); + } + }); + + tc.createExecutor(engine) + .simulateProcess("advanced") + .withVariable("elements", elements) + .withVariable("nestedElements", nestedElements) + .verify(ProcessInstanceAssert::isCompleted) + .execute(); + } + + private class TestCase extends AbstractJUnit5TestCase { + + @Override + protected void execute(TestCaseInstance instance, long processInstanceKey) { + instance.hasPassed(processInstanceKey, "startEvent"); + instance.apply(processInstanceKey, handler); + instance.hasPassedMultiInstance(processInstanceKey, "subProcess"); + instance.hasPassed(processInstanceKey, "endEvent"); + } + + @Override + public String getBpmnProcessId() { + return "scopeNested"; + } + + @Override + protected InputStream getBpmnResource() { + try { + return Files.newInputStream(TestPaths.advancedMultiInstance("scopeNested.bpmn")); + } catch (IOException e) { + return null; + } + } + + @Override + public String getStart() { + return "startEvent"; + } + + @Override + public String getEnd() { + return "endEvent"; + } + } +} diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeSequentialTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeSequentialTest.java new file mode 100644 index 00000000..47af4e1f --- /dev/null +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/MultiInstanceScopeSequentialTest.java @@ -0,0 +1,102 @@ +package org.camunda.community.bpmndt.api; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.List; + +import org.camunda.community.bpmndt.test.TestPaths; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.camunda.zeebe.client.ZeebeClient; +import io.camunda.zeebe.process.test.api.ZeebeTestEngine; +import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert; +import io.camunda.zeebe.process.test.extension.ZeebeProcessTest; + +@ZeebeProcessTest +class MultiInstanceScopeSequentialTest { + + @RegisterExtension + TestCase tc = new TestCase(); + + ZeebeTestEngine engine; + ZeebeClient client; + + private CustomMultiInstanceHandler handler; + + @BeforeEach + public void setUp() { + handler = new CustomMultiInstanceHandler("multiInstanceScope"); + } + + @Test + void testExecute() { + var elements = List.of(1, 2, 3); + + handler.execute((testCaseInstance, processInstanceKey) -> { + var userTaskHandler = new UserTaskHandler("userTask"); + var messageCatchEventHandler = new MessageEventHandler("messageCatchEvent"); + var serviceTaskHandler = new JobHandler("serviceTask"); + var callActivityHandler = new CallActivityHandler("callActivity"); + + for (int i = 0; i < elements.size(); i++) { + testCaseInstance.apply(processInstanceKey, userTaskHandler); + testCaseInstance.apply(processInstanceKey, messageCatchEventHandler); + + var workerBuilder = client.newWorker() + .jobType("advanced") + .handler((client, job) -> client.newCompleteCommand(job).send()); + + try (var ignored = workerBuilder.open()) { + testCaseInstance.apply(processInstanceKey, serviceTaskHandler); + testCaseInstance.hasPassed(processInstanceKey, "serviceTask"); + } + + testCaseInstance.apply(processInstanceKey, callActivityHandler); + } + }); + + tc.createExecutor(engine) + .simulateProcess("advanced") + .withVariable("elements", elements) + .verify(ProcessInstanceAssert::isCompleted) + .execute(); + } + + private class TestCase extends AbstractJUnit5TestCase { + + @Override + protected void execute(TestCaseInstance instance, long processInstanceKey) { + instance.hasPassed(processInstanceKey, "startEvent"); + instance.apply(processInstanceKey, handler); + instance.hasPassedMultiInstance(processInstanceKey, "multiInstanceScope"); + instance.hasPassed(processInstanceKey, "endEvent"); + } + + @Override + public String getBpmnProcessId() { + return "scopeSequential"; + } + + @Override + protected InputStream getBpmnResource() { + try { + return Files.newInputStream(TestPaths.advancedMultiInstance("scopeSequential.bpmn")); + } catch (IOException e) { + return null; + } + } + + @Override + public String getStart() { + return "startEvent"; + } + + @Override + public String getEnd() { + return "endEvent"; + } + } +} diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ReceiveTaskTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ReceiveTaskTest.java index 9a54f0a4..2b722739 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ReceiveTaskTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ReceiveTaskTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.MessageEventElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,12 +25,7 @@ class ReceiveTaskTest { @BeforeEach void setUp() { - var element = new MessageEventElement(); - element.id = "receiveTask"; - element.correlationKey = "=\"simple\""; - element.messageName = "=\"simpleMessage\""; - - handler = new MessageEventHandler(element); + handler = new MessageEventHandler("receiveTask"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ScriptTaskTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ScriptTaskTest.java index 0ec6fe31..b6609503 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ScriptTaskTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ScriptTaskTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,11 +27,7 @@ class ScriptTaskTest { @BeforeEach void setUp() { - var element = new JobElement(); - element.id = "scriptTask"; - element.type = "scriptTaskType"; - - handler = new JobHandler(element); + handler = new JobHandler("scriptTask"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/SendTaskTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/SendTaskTest.java index 624da6aa..d2a1c655 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/SendTaskTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/SendTaskTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,11 +27,7 @@ class SendTaskTest { @BeforeEach void setUp() { - var element = new JobElement(); - element.id = "sendTask"; - element.type = "sendTaskType"; - - handler = new JobHandler(element); + handler = new JobHandler("sendTask"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskErrorTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskErrorTest.java index d31c8698..4bae00b7 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskErrorTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskErrorTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,10 +27,7 @@ class ServiceTaskErrorTest { @BeforeEach void setUp() { - var element = new JobElement(); - element.id = "serviceTask"; - - handler = new JobHandler(element); + handler = new JobHandler("serviceTask"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskMessageTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskMessageTest.java index 214fb45a..6bab500d 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskMessageTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/ServiceTaskMessageTest.java @@ -4,8 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.JobElement; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.MessageEventElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,16 +26,8 @@ class ServiceTaskMessageTest { @BeforeEach void setUp() { - var element = new JobElement(); - element.id = "serviceTask"; - - handler = new JobHandler(element); - - var boundaryEventElement = new MessageEventElement(); - boundaryEventElement.id = "messageBoundaryEvent"; - boundaryEventElement.messageName = "advancedMessage"; - - boundaryEventHandler = new MessageEventHandler(boundaryEventElement); + handler = new JobHandler("serviceTask"); + boundaryEventHandler = new MessageEventHandler("messageBoundaryEvent"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/TimerEventHandlerTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/TimerEventHandlerTest.java index 42b4b0b3..51d330ed 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/TimerEventHandlerTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/TimerEventHandlerTest.java @@ -8,7 +8,7 @@ class TimerEventHandlerTest { @Test void testToDuration() { - var handler = new TimerEventHandler(null); + var handler = new TimerEventHandler(""); assertThat(handler.toDuration(1000, 0).toMillis()).isEqualTo(1000); assertThat(handler.toDuration(1000, 1).toMillis()).isEqualTo(1000); diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskErrorTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskErrorTest.java index 5bbdfe5e..0ddcdd7e 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskErrorTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskErrorTest.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.UserTaskElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,10 +25,7 @@ class UserTaskErrorTest { @BeforeEach void setUp() { - var element = new UserTaskElement(); - element.id = "userTask"; - - handler = new UserTaskHandler(element); + handler = new UserTaskHandler("userTask"); } @Test diff --git a/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskMessageTest.java b/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskMessageTest.java index 0cca8f7f..b94a44ad 100644 --- a/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskMessageTest.java +++ b/impl-8/src/test/java/org/camunda/community/bpmndt/api/UserTaskMessageTest.java @@ -4,8 +4,6 @@ import java.io.InputStream; import java.nio.file.Files; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.MessageEventElement; -import org.camunda.community.bpmndt.api.TestCaseInstanceElement.UserTaskElement; import org.camunda.community.bpmndt.test.TestPaths; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,16 +26,9 @@ class UserTaskMessageTest { @BeforeEach void setUp() { - var element = new UserTaskElement(); - element.id = "userTask"; - handler = new UserTaskHandler(element); - - var boundaryEventElement = new MessageEventElement(); - boundaryEventElement.id = "messageBoundaryEvent"; - boundaryEventElement.messageName = "advancedMessage"; - - boundaryEventHandler = new MessageEventHandler(boundaryEventElement); + handler = new UserTaskHandler("userTask"); + boundaryEventHandler = new MessageEventHandler("messageBoundaryEvent"); } @Test diff --git a/integration-tests-8/advanced-multi-instance/pom.xml b/integration-tests-8/advanced-multi-instance/pom.xml index 538bd17f..5d3eeefe 100644 --- a/integration-tests-8/advanced-multi-instance/pom.xml +++ b/integration-tests-8/advanced-multi-instance/pom.xml @@ -26,7 +26,8 @@ - org.immutables + + org.immutables annotate 2.10.0 provided diff --git a/integration-tests-8/advanced-multi-instance/src/main/resources/scopeSequential.bpmn b/integration-tests-8/advanced-multi-instance/src/main/resources/scopeSequential.bpmn index d10cfc3b..c6581abf 100644 --- a/integration-tests-8/advanced-multi-instance/src/main/resources/scopeSequential.bpmn +++ b/integration-tests-8/advanced-multi-instance/src/main/resources/scopeSequential.bpmn @@ -74,7 +74,7 @@ - + diff --git a/integration-tests-8/advanced.robot b/integration-tests-8/advanced.robot new file mode 100644 index 00000000..665ef6dc --- /dev/null +++ b/integration-tests-8/advanced.robot @@ -0,0 +1,54 @@ +* Settings +Library OperatingSystem +Library Process + +* Test Cases +mvn clean test + [Tags] xignore maven + ${result}= Run process + ... mvn -B -f ${CURDIR}/advanced/pom.xml clean test -Dplugin.version\=${VERSION} + ... shell=True stdout=${TEMP}/advanced.out stderr=STDOUT + + Log ${result.stdout} + + # plugin executed + Should contain ${result.stdout} bpmn-driven-testing-8-maven-plugin:${VERSION}:generator + + # tests executed + Should contain ${result.stdout} Running org.example.it.CallActivityErrorTest + Should contain ${result.stdout} Running org.example.it.CallActivityEscalationTest + Should contain ${result.stdout} Running org.example.it.CallActivityMessageTest + Should contain ${result.stdout} Running org.example.it.CallActivitySignalTest + Should contain ${result.stdout} Running org.example.it.CallActivityTimerTest + Should contain ${result.stdout} Running org.example.it.CollaborationTest + Should contain ${result.stdout} Running org.example.it.LinkEventTest + Should contain ${result.stdout} Running org.example.it.ServiceTaskErrorTest + Should contain ${result.stdout} Running org.example.it.ServiceTaskMessageTest + Should contain ${result.stdout} Running org.example.it.ServiceTaskSignalTest + Should contain ${result.stdout} Running org.example.it.ServiceTaskTimerTest + Should contain ${result.stdout} Running org.example.it.UserTaskErrorTest + Should contain ${result.stdout} Running org.example.it.UserTaskMessageTest + Should contain ${result.stdout} Running org.example.it.UserTaskSignalTest + Should contain ${result.stdout} Running org.example.it.UserTaskTimerTest + # tests executed successfully + Should contain ${result.stdout} Failures: 0, Errors: 0, Skipped: 0 + + Should be equal as integers ${result.rc} 0 + +gradle clean build + [Tags] xignore gradle + ${result}= Run process + ... gradle -p ${CURDIR}/advanced clean build -Pplugin.version\=${VERSION} --info --stacktrace + ... shell=True stdout=${TEMP}/advanced.out stderr=STDOUT + + Log ${result.stdout} + + # task executed + Should contain ${result.stdout} > Task :generateTestCases + + # tests executed + Should contain ${result.stdout} finished executing tests + # tests executed successfully + Should contain ${result.stdout} Failures: 0, Skipped: 0 + + Should be equal as integers ${result.rc} 0 diff --git a/integration-tests-8/advanced/pom.xml b/integration-tests-8/advanced/pom.xml index 0954eaef..7e79394d 100644 --- a/integration-tests-8/advanced/pom.xml +++ b/integration-tests-8/advanced/pom.xml @@ -26,7 +26,8 @@ - org.immutables + + org.immutables annotate 2.10.0 provided diff --git a/integration-tests-8/simple.robot b/integration-tests-8/simple.robot index bb9a03ca..698f6cdb 100644 --- a/integration-tests-8/simple.robot +++ b/integration-tests-8/simple.robot @@ -115,7 +115,7 @@ Assert Test Code Generation Should contain ${result.stdout} Test case #1 has an incomplete path Should contain ${result.stdout} Process: invalid - Should contain ${result.stdout} Test case #1 has an invalid path - invalid flow node IDs: [a, b] + Should contain ${result.stdout} Test case #1 has an invalid path - invalid element IDs: [a, b] Should contain ${result.stdout} Process: noTestCases Should contain ${result.stdout} No test cases defined @@ -134,7 +134,7 @@ Assert Test Code Generation Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simpleeventbasedgateway/TC_startEvent__eventBasedGateway.java Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simpleeventbasedgateway/TC_Timer.java Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplemessagecatchevent/TC_startEvent__endEvent.java - Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplemessageendevent/TC_startEvent__endEvent.java + Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplemessageendevent/TC_startEvent__messageEndEvent.java Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplemessagestartevent/TC_messageStartEvent__endEvent.java Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplemessagethrowevent/TC_startEvent__endEvent.java Should contain ${result.stdout} Writing file: ${buildDir}/bpmndt/generated/simplereceivetask/TC_startEvent__endEvent.java @@ -160,7 +160,7 @@ Assert Test Code Generation File should exist ${testSources}/generated/simpleeventbasedgateway/TC_startEvent__eventBasedGateway.java File should exist ${testSources}/generated/simpleeventbasedgateway/TC_Timer.java File should exist ${testSources}/generated/simplemessagecatchevent/TC_startEvent__endEvent.java - File should exist ${testSources}/generated/simplemessageendevent/TC_startEvent__endEvent.java + File should exist ${testSources}/generated/simplemessageendevent/TC_startEvent__messageEndEvent.java File should exist ${testSources}/generated/simplemessagestartevent/TC_messageStartEvent__endEvent.java File should exist ${testSources}/generated/simplemessagethrowevent/TC_startEvent__endEvent.java File should exist ${testSources}/generated/simplereceivetask/TC_startEvent__endEvent.java diff --git a/integration-tests-8/simple/pom.xml b/integration-tests-8/simple/pom.xml index 2a456bc8..37afb989 100644 --- a/integration-tests-8/simple/pom.xml +++ b/integration-tests-8/simple/pom.xml @@ -27,7 +27,7 @@ - org.immutables + org.immutables annotate 2.10.0 provided diff --git a/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScope.java b/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScope.java index 89a643de..813987ff 100644 --- a/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScope.java +++ b/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScope.java @@ -85,14 +85,6 @@ public interface BpmnElementScope { */ boolean isMultiInstance(); - /** - * Determines if the scope is a parallel multi instance. - * - * @return {@code true}, if the scope is a parallel multi instance. Otherwise {@code false}. - * @throws IllegalStateException If the scope is not a multi instance. - */ - boolean isMultiInstanceParallel(); - /** * Determines if the scope is a sequential multi instance. * diff --git a/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScopeImpl.java b/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScopeImpl.java index 50ebc7bd..f278debd 100644 --- a/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScopeImpl.java +++ b/model-8/src/main/java/org/camunda/community/bpmndt/model/BpmnElementScopeImpl.java @@ -85,11 +85,6 @@ public boolean isMultiInstance() { return multiInstanceLoopCharacteristics != null; } - @Override - public boolean isMultiInstanceParallel() { - return !isMultiInstanceSequential(); - } - @Override public boolean isMultiInstanceSequential() { if (!isMultiInstance()) { diff --git a/model-8/src/test/java/org/camunda/community/bpmndt/model/TestCasesTest.java b/model-8/src/test/java/org/camunda/community/bpmndt/model/TestCasesTest.java index 15713c5b..b809605b 100644 --- a/model-8/src/test/java/org/camunda/community/bpmndt/model/TestCasesTest.java +++ b/model-8/src/test/java/org/camunda/community/bpmndt/model/TestCasesTest.java @@ -202,7 +202,6 @@ public void testMultiInstanceScopeNested() { assertThat(scope.getParent()).isNotNull(); assertThat(scope.hasParent()).isTrue(); assertThat(scope.isMultiInstance()).isTrue(); - assertThat(scope.isMultiInstanceParallel()).isFalse(); assertThat(scope.isMultiInstanceSequential()).isTrue(); scope = scope.getParent(); @@ -217,7 +216,6 @@ public void testMultiInstanceScopeNested() { assertThat(scope.getParent()).isNull(); assertThat(scope.hasParent()).isFalse(); assertThat(scope.isMultiInstance()).isTrue(); - assertThat(scope.isMultiInstanceParallel()).isFalse(); assertThat(scope.isMultiInstanceSequential()).isTrue(); testCase = testCases.get().get(1);