Package org.flowable.idm.engine.test
Class InternalFlowableIdmExtension
java.lang.Object
org.flowable.idm.engine.test.InternalFlowableIdmExtension
- 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
- Direct Known Subclasses:
PluggableFlowableIdmExtension
,ResourceFlowableIdmExtension
public abstract class InternalFlowableIdmExtension
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:
-
Assert and ensure a clean db after each test or after all tests (depending on the
TestInstance.Lifecycle
. -
Support for injecting the
IdmEngine
.
- Author:
- Filip Hrisafov
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAll
(org.junit.jupiter.api.extension.ExtensionContext context) void
afterEach
(org.junit.jupiter.api.extension.ExtensionContext context) protected void
assertAndEnsureCleanDb
(IdmEngine idmEngine, org.junit.jupiter.api.extension.ExtensionContext context, EnsureCleanDb ensureCleanDb) Each test is assumed to clean up all DB content it entered.void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) protected void
cleanTestAndAssertAndEnsureCleanDb
(org.junit.jupiter.api.extension.ExtensionContext context, IdmEngine idmEngine) protected void
doFinally
(org.junit.jupiter.api.extension.ExtensionContext context, org.junit.jupiter.api.TestInstance.Lifecycle lifecycleForClean) protected abstract IdmEngine
getIdmEngine
(org.junit.jupiter.api.extension.ExtensionContext context) protected abstract org.junit.jupiter.api.extension.ExtensionContext.Store
getStore
(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)
-
Field Details
-
EMPTY_LINE
- See Also:
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
InternalFlowableIdmExtension
public InternalFlowableIdmExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) - Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
-
afterEach
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
Exception
-
afterAll
- Specified by:
afterAll
in 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, IdmEngine idmEngine) -
assertAndEnsureCleanDb
protected void assertAndEnsureCleanDb(IdmEngine idmEngine, 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. -
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
-
getIdmEngine
-
getStore
protected abstract org.junit.jupiter.api.extension.ExtensionContext.Store getStore(org.junit.jupiter.api.extension.ExtensionContext context)
-