-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
kind/featureCategorizes an issue or PR as a feature, i.e. new behaviorCategorizes an issue or PR as a feature, i.e. new behavior
Description
Description
I'm quite new to Camunda so I'm not sure if this is my own lack of experience, or if this can be handled in a slightly better way.
Currently I've found that my tests only pass when I use the engine.waitForIdleState method before doing assertions. As this is always needed, could this not be abstracted into the testing library itself?
This is my workaround at the moment:
// resolve task
client.newCompleteCommand(job.key)
.variables(variables)
.send()
.join()
// assert when the task has completed
assertWhenIdle {
BpmnAssert.assertThat(instance)
.hasPassedElementsInOrder(<..>)
}With a base class that has the assertWhenIdle method:
protected fun assertWhenIdle(assertions: () -> ProcessInstanceAssert) {
// Wait for currently running tasks to complete
engine!!.waitForIdleState(Duration.ofMillis(Constants.IDLE_TIMEOUT_MILLIS))
// Run assertions
assertions()
}Am I doing something wrong? It doesn't seem ideal that I'm forced to add in the wait for idle state for every assertion in my test suite.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes an issue or PR as a feature, i.e. new behaviorCategorizes an issue or PR as a feature, i.e. new behavior