Skip to content

Instantly share code, notes, and snippets.

@l0co
Created February 7, 2019 11:59
Show Gist options
  • Select an option

  • Save l0co/7e6c5ad1f557db38222ba75bd3ae5596 to your computer and use it in GitHub Desktop.

Select an option

Save l0co/7e6c5ad1f557db38222ba75bd3ae5596 to your computer and use it in GitHub Desktop.
abstract class BaseProcessTest {
fun startProcess(variables: Map<String, Any> = mapOf()): ProcessAssertions {
logger.debug("Starting process: ${processName()}")
val processTestEnvironment = ProcessTestEnvironment()
runtimeService.addEventListener(processTestEnvironment)
try {
runtimeService.startProcessInstanceByKey(processName(), variables)
} catch(e: Throwable) {
processTestEnvironment.exception = e
} finally {
runtimeService.removeEventListener(processTestEnvironment)
}
return ProcessAssertions(processTestEnvironment)
}
// [...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment