Class StubAggregateLifecycleExtension

All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.Extension

public class StubAggregateLifecycleExtension extends StubAggregateLifecycle implements org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeEachCallback
Implementation of StubAggregateLifecycle that can be used as an RegisterExtension annotated method or field in a test class. In that case, the JUnit lifecycle will automatically register and deregister the StubAggregateLifecycle.

Usage example:

 @RegisterExtension
 public StubAggregateLifecycleExtension lifecycle = new StubAggregateLifecycleExtension();

 @Test
 public void testMethod() {
     ... perform tests ...

     // get applied events from lifecycle to validate some more
     lifecycle.getAppliedEvents();
 }
 
  • Constructor Details

    • StubAggregateLifecycleExtension

      public StubAggregateLifecycleExtension()
  • Method Details

    • beforeEach

      public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
      Throws:
      Exception
    • afterEach

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
      Throws:
      Exception