use of org.jbpm.test.listener.IterableProcessEventListener.TrackedEvent in project jbpm by kiegroup.
the class IterableListenerAssert method assertProcessCompleted.
/**
* Asserts that the process was completed
*
* @param it listener that listened to the process
* @param processId id of the process
*/
public static void assertProcessCompleted(IterableProcessEventListener it, String processId) {
TrackedEvent event = getEvent(it);
Assertions.assertThat(event.getMethod()).isEqualTo(BEFORE_COMPLETED);
CachedProcessCompletedEvent orig = event.getEvent();
Assertions.assertThat(orig.getProcessId()).isEqualTo(processId);
}
use of org.jbpm.test.listener.IterableProcessEventListener.TrackedEvent in project jbpm by kiegroup.
the class IterableListenerAssert method assertMultipleVariablesChanged.
/**
* When multiple variables are initialized order might be different on
* different JVMs.
*
* @param it listener that listened to the process
* @param variables names of changed variables
*/
public static void assertMultipleVariablesChanged(IterableProcessEventListener it, String... variables) {
for (int i = 0; i < variables.length; i++) {
TrackedEvent event = getEvent(it);
Assertions.assertThat(event.getMethod()).isEqualTo(BEFORE_VARIABLE);
ProcessVariableChangedEvent orig = event.getEvent();
boolean found = false;
String name = null;
for (String str : variables) {
found = orig.getVariableId().equals(str);
name = str;
if (found) {
break;
}
}
Assertions.assertThat(found).isTrue();
event = it.next();
Assertions.assertThat(event.getMethod()).isEqualTo(AFTER_VARIABLE);
orig = event.getEvent();
Assertions.assertThat(orig.getVariableId().equals(name)).isTrue();
}
}
use of org.jbpm.test.listener.IterableProcessEventListener.TrackedEvent in project jbpm by kiegroup.
the class IterableListenerAssert method assertProcessStarted.
/**
* Asserts that the process was started
*
* @param it listener that listened to the process
* @param processId id of the process
*/
public static void assertProcessStarted(IterableProcessEventListener it, String processId) {
TrackedEvent event = getEvent(it);
Assertions.assertThat(event.getMethod()).isEqualTo(BEFORE_STARTED);
CachedProcessStartedEvent orig = event.getEvent();
Assertions.assertThat(orig.getProcessId()).isEqualTo(processId);
}
use of org.jbpm.test.listener.IterableProcessEventListener.TrackedEvent in project jbpm by kiegroup.
the class IterableListenerAssert method assertLeft.
/**
* Asserts that the node with the given name was left
*
* @param it listener that listened to the process
* @param nodeName name of the node that is expected to be left
*/
public static void assertLeft(IterableProcessEventListener it, String nodeName) {
TrackedEvent event = getEvent(it);
Assertions.assertThat(event.getMethod()).isEqualTo(BEFORE_LEFT);
CachedProcessNodeLeftEvent orig = event.getEvent();
Assertions.assertThat(orig.getNodeName()).isEqualTo(nodeName);
}
use of org.jbpm.test.listener.IterableProcessEventListener.TrackedEvent in project jbpm by kiegroup.
the class IterableListenerAssert method assertTriggered.
/**
* Asserts that the node with the given name was triggered
*
* @param it listener that listened to the process
* @param nodeName name of the node that is expected to be triggered
*/
public static void assertTriggered(IterableProcessEventListener it, String nodeName) {
TrackedEvent event = getEvent(it);
Assertions.assertThat(event.getMethod()).isEqualTo(BEFORE_TRIGGERED);
CachedProcessNodeTriggeredEvent orig = event.getEvent();
Assertions.assertThat(orig.getNodeName()).isEqualTo(nodeName);
}
Aggregations