Class ZeebeProcessTestExtension
java.lang.Object
io.camunda.zeebe.process.test.extension.ZeebeProcessTestExtension
- 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.TestWatcher
public class ZeebeProcessTestExtension
extends Object
implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.TestWatcher
This extension is used by the
ZeebeProcessTest annotation. It is responsible for managing
the lifecycle of the test engine.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) After each test the test engine en client will be closed.voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Before each test a new test engine gets created and started.voidtestFailed(org.junit.jupiter.api.extension.ExtensionContext extensionContext, Throwable cause) Upon test failure an overview of occurred events and incidents will be logged.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.TestWatcher
testAborted, testDisabled, testSuccessful
-
Constructor Details
-
ZeebeProcessTestExtension
public ZeebeProcessTestExtension()
-
-
Method Details
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Before each test a new test engine gets created and started. A client to communicate with the engine will also be created. Together with aRecordStreamthese will be injected in the fields of the test class, if they are available.- Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback- Parameters:
extensionContext- jUnit5 extension context
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) After each test the test engine en client will be closed. TheRecordStreamwill get reset.- Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback- Parameters:
extensionContext- jUnit5 extension context
-
testFailed
public void testFailed(org.junit.jupiter.api.extension.ExtensionContext extensionContext, Throwable cause) Upon test failure an overview of occurred events and incidents will be logged.- Specified by:
testFailedin interfaceorg.junit.jupiter.api.extension.TestWatcher- Parameters:
extensionContext- jUnit5 extension contextcause- the throwable that caused the test failure
-