Class FlowableAppExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension,org.junit.jupiter.api.extension.ParameterResolver,org.junit.jupiter.api.extension.TestInstantiationAwareExtension
Usage:
@ExtendWith(FlowableAppExtension.class)
class YourTest {
@BeforeEach
void setUp(AppEngine appEngine) {
...
}
@Test
void myTest(AppRepositoryService appRepositoryService) {
...
}
...
}
The AppEngine and the services will be made available to the test class through the parameter resolution (BeforeEach, AfterEach, test methods).
The AppEngine will be initialized by default with the flowable.app.cfg.xml resource on the classpath.
To specify a different configuration file, annotate your class with AppConfigurationResource.
App 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 cmmn engine will be constructed.
You can declare a deployment with the AppDeployment annotation. This 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 AppDeploymentId in a test method.
- Author:
- Filip Hrisafov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) protected AppEnginecreateAppEngine(org.junit.jupiter.api.extension.ExtensionContext context) protected StringgetConfigurationResource(org.junit.jupiter.api.extension.ExtensionContext context) protected org.junit.jupiter.api.extension.ExtensionContext.StoregetStore(org.junit.jupiter.api.extension.ExtensionContext context) protected FlowableAppTestHelpergetTestHelper(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) booleansupportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Field Details
-
DEFAULT_CONFIGURATION_RESOURCE
- See Also:
-
-
Constructor Details
-
FlowableAppExtension
public FlowableAppExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException - Specified by:
supportsParameterin interfaceorg.junit.jupiter.api.extension.ParameterResolver- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
resolveParameter
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException - Specified by:
resolveParameterin interfaceorg.junit.jupiter.api.extension.ParameterResolver- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
getConfigurationResource
-
getTestHelper
protected FlowableAppTestHelper getTestHelper(org.junit.jupiter.api.extension.ExtensionContext context) -
createAppEngine
-
getStore
protected org.junit.jupiter.api.extension.ExtensionContext.Store getStore(org.junit.jupiter.api.extension.ExtensionContext context)
-