Annotation Interface HelidonTest


@Retention(RUNTIME) @Target(TYPE) @ExtendWith(io.helidon.microprofile.testing.junit5.HelidonJunitExtension.class) @Inherited public @interface HelidonTest
An annotation making this test class a CDI bean with support for injection.

There is no need to provide beans.xml (actually it is not recommended, as it would combine beans from all tests), instead use AddBean, AddExtension, and AddConfig annotations to control the shape of the container.

To disable automated bean and extension discovery, annotate the class with DisableDiscovery.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    By default, CDI container is created once before the class is initialized and shut down after.
  • Element Details

    • resetPerTest

      boolean resetPerTest
      By default, CDI container is created once before the class is initialized and shut down after. All test methods run within the same container. If this is set to true, a container is created per test method invocation. This restricts the test in the following way: 1. No injection into fields 2. No injection into constructor
      Returns:
      whether to reset container per test method
      Default:
      false