Package org.flowable.engine.impl.test
Class InternalFlowableExtension
java.lang.Object
org.flowable.engine.impl.test.InternalFlowableExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,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
- Direct Known Subclasses:
InternalFlowableSpringExtension,PluggableFlowableExtension,ResourceFlowableExtension
public abstract class InternalFlowableExtension
extends Object
implements org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.ParameterResolver
Base internal extension for JUnit Jupiter. This is a basis for other internal extensions. It allows:
-
Performs a deployment before each test when a test method is annotated with
Deployment - Validates the history data after each test
- Delete history jobs and deployment after each test
-
Assert and ensure a clean db after each test or after all tests (depending on the
TestInstance.Lifecycle. -
Support for injecting the
ProcessEngine, services,ProcessEngineConfigurationand the id of the deployment done viaDeploymentinto test methods and lifecycle methods within tests.
- 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 TypeMethodDescriptionvoidafterAll(org.junit.jupiter.api.extension.ExtensionContext context) voidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) protected voidassertAndEnsureCleanDb(ProcessEngine processEngine, org.junit.jupiter.api.extension.ExtensionContext context, EnsureCleanDb ensureCleanDb) Each test is assumed to clean up all DB content it entered.voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) protected voidcleanTestAndAssertAndEnsureCleanDb(org.junit.jupiter.api.extension.ExtensionContext context, ProcessEngine processEngine) protected voiddoFinally(org.junit.jupiter.api.extension.ExtensionContext context, org.junit.jupiter.api.TestInstance.Lifecycle lifecycleForClean) protected abstract ProcessEnginegetProcessEngine(org.junit.jupiter.api.extension.ExtensionContext context) protected abstract org.junit.jupiter.api.extension.ExtensionContext.StoregetStore(org.junit.jupiter.api.extension.ExtensionContext context) protected voidremoveDeployments(RepositoryService repositoryService) resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) booleansupportsParameter(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, waitMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Field Details
-
ANNOTATION_DEPLOYMENT_ID_KEY
- See Also:
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
InternalFlowableExtension
public InternalFlowableExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterEach
- Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback- Throws:
Exception
-
afterAll
- Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback- Throws:
Exception
-
doFinally
protected void doFinally(org.junit.jupiter.api.extension.ExtensionContext context, org.junit.jupiter.api.TestInstance.Lifecycle lifecycleForClean) -
cleanTestAndAssertAndEnsureCleanDb
protected void cleanTestAndAssertAndEnsureCleanDb(org.junit.jupiter.api.extension.ExtensionContext context, ProcessEngine processEngine) -
assertAndEnsureCleanDb
protected void assertAndEnsureCleanDb(ProcessEngine processEngine, org.junit.jupiter.api.extension.ExtensionContext context, EnsureCleanDb ensureCleanDb) Each test is assumed to clean up all DB content it entered. After a test method executed, this method scans all tables to see if the DB is completely clean. It throws AssertionFailed in case the DB is not clean. If the DB is not clean, it is cleaned by performing a create a drop. -
removeDeployments
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
supportsParameterin 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:
resolveParameterin interfaceorg.junit.jupiter.api.extension.ParameterResolver
-
getProcessEngine
protected abstract ProcessEngine getProcessEngine(org.junit.jupiter.api.extension.ExtensionContext context) -
getStore
protected abstract org.junit.jupiter.api.extension.ExtensionContext.Store getStore(org.junit.jupiter.api.extension.ExtensionContext context)
-