Package com.flowable.app.engine.test
Class FlowableAppExtension
java.lang.Object
com.flowable.app.engine.test.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
public class FlowableAppExtension
extends Object
implements org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
JUnit Jupiter extension for the Flowable AppEngine and services initialization.
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 fetched as a bean through the SpringExtension
You can declare a deployment with the AppDeployment
annotation. This extension will make sure that this deployment gets deployed
before the setUp and AppRepositoryService.deleteDeployment(String, boolean)
deleted} after the tearDown.
The id of the deployment can be accessed by using AppDeploymentId
in a test method.
-
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 TypeMethodDescriptionvoid
afterEach
(org.junit.jupiter.api.extension.ExtensionContext context) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) protected static AppEngine
createAppEngine
(org.junit.jupiter.api.extension.ExtensionContext context) protected static org.junit.jupiter.api.extension.ExtensionContext.Store
getStore
(org.junit.jupiter.api.extension.ExtensionContext context) static FlowableAppTestHelper
getTestHelper
(org.junit.jupiter.api.extension.ExtensionContext context) resolveParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) boolean
supportsParameter
(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Field Details
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
FlowableAppExtension
public FlowableAppExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
supportsParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
-
resolveParameter
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
resolveParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
-
getTestHelper
public static FlowableAppTestHelper getTestHelper(org.junit.jupiter.api.extension.ExtensionContext context) -
createAppEngine
protected static AppEngine createAppEngine(org.junit.jupiter.api.extension.ExtensionContext context) -
getStore
protected static org.junit.jupiter.api.extension.ExtensionContext.Store getStore(org.junit.jupiter.api.extension.ExtensionContext context)
-