Class FlowableFormExtension
- 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
- Direct Known Subclasses:
- FlowableFormSpringExtension
public class FlowableFormExtension
extends java.lang.Object
implements org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
Usage:
 @ExtendWith(FlowableFormExtension.class)
 class YourTest {
   @BeforeEach
   void setUp(FormEngine FormEngine) {
       ...
   }
   @Test
   void myTest(FormRepositoryService formRepositoryService) {
       ...
   }
   ...
 }
 
 
 The FormEngine and the services will be made available to the test class through the parameter resolution (BeforeEach, AfterEach, test methods).
 The FormEngine will be initialized by default with the flowable.form.cfg.xml resource on the classpath.
 To specify a different configuration file, annotate your class with FormConfigurationResource.
 Form 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 form engine will be constructed.
 
 You can declare a deployment with the FormDeploymentAnnotation annotation. This extension will make sure that this deployment gets deployed
 before the setUp and deleted after the tearDown.
 The id of the deployment can be accessed by using FormDeploymentId in a test method.
 
 FlowableFormTestHelper.setCurrentTime(Date)  can be used to set the current time used by the form engine}
 This can be handy to control the exact time that is used by the engine in order to verify for example 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
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringconfigurationResourcestatic java.lang.StringDEFAULT_CONFIGURATION_RESOURCEprotected org.slf4j.Loggerlogger
- 
Constructor SummaryConstructors Constructor Description FlowableFormExtension()FlowableFormExtension(java.lang.String configurationResource)
- 
Method SummaryModifier and Type Method Description voidafterEach(org.junit.jupiter.api.extension.ExtensionContext context)voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context)protected FormEnginecreateFormEngine(org.junit.jupiter.api.extension.ExtensionContext context)protected java.lang.StringgetConfigurationResource(org.junit.jupiter.api.extension.ExtensionContext context)protected org.junit.jupiter.api.extension.ExtensionContext.StoregetStore(org.junit.jupiter.api.extension.ExtensionContext context)protected FlowableFormTestHelpergetTestHelper(org.junit.jupiter.api.extension.ExtensionContext context)java.lang.ObjectresolveParameter(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)
- 
Field Details- 
DEFAULT_CONFIGURATION_RESOURCEpublic static final java.lang.String DEFAULT_CONFIGURATION_RESOURCE- See Also:
- Constant Field Values
 
- 
loggerprotected final org.slf4j.Logger logger
- 
configurationResourceprotected final java.lang.String configurationResource
 
- 
- 
Constructor Details- 
FlowableFormExtensionpublic FlowableFormExtension()
- 
FlowableFormExtensionpublic FlowableFormExtension(java.lang.String configurationResource)
 
- 
- 
Method Details- 
beforeEachpublic void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)- Specified by:
- beforeEachin interface- org.junit.jupiter.api.extension.BeforeEachCallback
 
- 
afterEachpublic void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)- Specified by:
- afterEachin interface- org.junit.jupiter.api.extension.AfterEachCallback
 
- 
supportsParameterpublic boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context)- Specified by:
- supportsParameterin interface- org.junit.jupiter.api.extension.ParameterResolver
 
- 
resolveParameterpublic java.lang.Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext context)- Specified by:
- resolveParameterin interface- org.junit.jupiter.api.extension.ParameterResolver
 
- 
getConfigurationResourceprotected java.lang.String getConfigurationResource(org.junit.jupiter.api.extension.ExtensionContext context)
- 
getTestHelperprotected FlowableFormTestHelper getTestHelper(org.junit.jupiter.api.extension.ExtensionContext context)
- 
createFormEngine
- 
getStoreprotected org.junit.jupiter.api.extension.ExtensionContext.Store getStore(org.junit.jupiter.api.extension.ExtensionContext context)
 
-