Annotation Interface QuarkusComponentTest


@ExtendWith(QuarkusComponentTestExtension.class) @Retention(RUNTIME) @Target(TYPE) public @interface QuarkusComponentTest
Registers the QuarkusComponentTestExtension that makes it easy to test Quarkus components and mock their dependencies.
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If set to true then all static nested classes are considered additional components under test.
    Class<? extends io.quarkus.arc.processor.AnnotationsTransformer>[]
    The additional annotation transformers.
    Class<? extends org.eclipse.microprofile.config.spi.Converter<?>>[]
    The additional config converters.
    int
    The ordinal of the config source used for all test config properties.
    boolean
    Indicates that the default values should be used for missing config properties.
    boolean
    If set to true then config sources for system properties and ENV variables are included in the test config.
    Class<?>[]
    The set of additional components under test.
  • Element Details

    • value

      Class<?>[] value
      The set of additional components under test.

      The initial set of components is derived from the test class. The types of all fields annotated with Inject are considered the component types. Furthermore, all types of parameters of test methods that are not annotated with InjectMock or SkipInject are also considered the component types. Finally, if addNestedClassesAsComponents() is set to true then all static nested classes declared on the test class are components too.

      Returns:
      the additional components under test
      See Also:
      Default:
      {}
    • useDefaultConfigProperties

      boolean useDefaultConfigProperties
      Indicates that the default values should be used for missing config properties.

      If set to false (default) then a missing config property always results in a test failure.

      For primitives the default values as defined in the JLS are used. For any other type null is injected.

      See Also:
      Default:
      false
    • addNestedClassesAsComponents

      boolean addNestedClassesAsComponents
      If set to true then all static nested classes are considered additional components under test.
      See Also:
      Default:
      true
    • configSourceOrdinal

      int configSourceOrdinal
      The ordinal of the config source used for all test config properties.
      See Also:
      Default:
      500
    • annotationsTransformers

      Class<? extends io.quarkus.arc.processor.AnnotationsTransformer>[] annotationsTransformers
      The additional annotation transformers.

      The initial set includes the JaxrsSingletonTransformer.

      See Also:
      Default:
      {}
    • configConverters

      Class<? extends org.eclipse.microprofile.config.spi.Converter<?>>[] configConverters
      The additional config converters. By default, the Quarkus-specific converters are registered.
      See Also:
      Default:
      {}
    • useSystemConfigSources

      boolean useSystemConfigSources
      If set to true then config sources for system properties and ENV variables are included in the test config.
      See Also:
      Default:
      false