Class SingletonRule

java.lang.Object
dev.enola.common.context.testlib.SingletonRule
All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestWatcher

public class SingletonRule extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.TestWatcher
JUnit Jupiter Extension for Singleton.
  • Method Details

    • $

      public static SingletonRule $(Singleton<?>... singletons)
      Intended to be statically imported into *Test classes.
    • onlyReset

      public static SingletonRule onlyReset(Singleton<?>... singletons)
    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
    • beforeEach

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

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
    • afterAll

      public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
    • testDisabled

      public void testDisabled(org.junit.jupiter.api.extension.ExtensionContext context, Optional<String> reason)
      Specified by:
      testDisabled in interface org.junit.jupiter.api.extension.TestWatcher
    • doNotReset

      public void doNotReset()