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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    After each test the test engine en client will be closed.
    void
    beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    Before each test a new test engine gets created and started.
    void
    testFailed(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, wait

    Methods 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 a RecordStream these will be injected in the fields of the test class, if they are available.
      Specified by:
      beforeEach in interface org.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. The RecordStream will get reset.
      Specified by:
      afterEach in interface org.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:
      testFailed in interface org.junit.jupiter.api.extension.TestWatcher
      Parameters:
      extensionContext - jUnit5 extension context
      cause - the throwable that caused the test failure