Class InjectExtension

java.lang.Object
io.avaje.inject.test.InjectExtension
All Implemented Interfaces:
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.ExtensionContext.Store.CloseableResource

public class InjectExtension
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.ExtensionContext.Store.CloseableResource
Junit 5 extension for avaje inject.

Supports injection for fields annotated with @Mock, @Spy, @Captor, @Inject.

  • Constructor Summary

    Constructors
    Constructor Description
    InjectExtension()  
  • Method Summary

    Modifier and Type Method Description
    void afterEach​(org.junit.jupiter.api.extension.ExtensionContext context)
    Callback that is invoked after each test has been invoked.
    void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)  
    void beforeEach​(org.junit.jupiter.api.extension.ExtensionContext context)
    Callback that is invoked before each test is invoked.
    void close()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • beforeAll

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

      public void close() throws Throwable
      Specified by:
      close in interface org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
      Throws:
      Throwable
    • beforeEach

      public void beforeEach​(org.junit.jupiter.api.extension.ExtensionContext context)
      Callback that is invoked before each test is invoked.
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
    • afterEach

      public void afterEach​(org.junit.jupiter.api.extension.ExtensionContext context)
      Callback that is invoked after each test has been invoked.
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback