Package io.quarkus.test.component
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 ElementsModifier and TypeOptional ElementDescriptionbooleanIf set totruethen 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.intThe ordinal of the config source used for all test config properties.booleanIndicates that the default values should be used for missing config properties.booleanIf set totruethen 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<?>[] valueThe set of additional components under test.The initial set of components is derived from the test class. The types of all fields annotated with
Injectare considered the component types. Furthermore, all types of parameters of test methods that are not annotated withInjectMockorSkipInjectare also considered the component types. Finally, ifaddNestedClassesAsComponents()is set totruethen all static nested classes declared on the test class are components too.- Returns:
- the additional components under test
- See Also:
- Default:
{}
-
useDefaultConfigProperties
boolean useDefaultConfigPropertiesIndicates 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
nullis injected.- See Also:
- Default:
false
-
addNestedClassesAsComponents
boolean addNestedClassesAsComponentsIf set totruethen all static nested classes are considered additional components under test.- See Also:
- Default:
true
-
configSourceOrdinal
int configSourceOrdinalThe ordinal of the config source used for all test config properties.- See Also:
- Default:
500
-
annotationsTransformers
Class<? extends io.quarkus.arc.processor.AnnotationsTransformer>[] annotationsTransformersThe additional annotation transformers.The initial set includes the
JaxrsSingletonTransformer.- See Also:
- Default:
{}
-
configConverters
Class<? extends org.eclipse.microprofile.config.spi.Converter<?>>[] configConvertersThe additional config converters. By default, the Quarkus-specific converters are registered.- See Also:
- Default:
{}
-
useSystemConfigSources
boolean useSystemConfigSourcesIf set totruethen config sources for system properties and ENV variables are included in the test config.- See Also:
- Default:
false
-