Annotation Interface FlowableTest
FlowableExtension
JUnit Jupiter annotation.
Usage:
@FlowableTest class YourTest { @BeforeEach void setUp(ProcessEngine processEngine) { ... } @Test void myTest(RuntimeService runtimeService) { ... } ... }
The ProcessEngine and the services will be made available to the test class through the parameter resolution (BeforeEach, AfterEach, test methods).
The processEngine will be initialized by default with the flowable.cfg.xml resource on the classpath.
To specify a different configuration file, annotate your class with ConfigurationResource
.
Process engines will be cached as part of the JUnit Jupiter Extension context.
Right before the first time the setUp is called for a given configuration resource, the process engine will be constructed.
You can declare a deployment with the Deployment
annotation. The extension will make sure that this deployment gets deployed before the setUp and
cascade deleted
after the tearDown.
The id of the deployment can be accessed by using DeploymentId
in a test method.
can be used to set the current time used by the process engine
This can be handy to control the exact time that is used by the engine in order to verify e.g. e.g. due dates of timers.
Or start, end and duration times in the history service. In the tearDown, the internal clock will automatically be reset to use the current system
time rather then the time that was set during a test method.
- Author:
- Filip Hrisafov