Package io.quarkus.test.component
Class QuarkusComponentTestExtensionBuilder
java.lang.Object
io.quarkus.test.component.QuarkusComponentTestExtensionBuilder
Convenient builder for
QuarkusComponentTestExtension.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBy default, test config properties take precedence over system properties (400), ENV variables (300) and application.properties (250) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotationsTransformer(AnnotationsTransformer transformer) Add an additionalAnnotationsTransformer.addComponentClasses(Class<?>... componentClasses) The initial set of components under test is derived from the test class.build()configProperty(String key, String value) Set a configuration property for the test.Ignore the static nested classes declared on the test class.<T> MockBeanConfigurator<T>Configure a new mock of a bean.(package private) voidregisterMockBean(MockBeanConfiguratorImpl<?> mock) setConfigSourceOrdinal(int val) Set the ordinal of the config source used for all test config properties.Use the default values for missing config properties.
-
Field Details
-
DEFAULT_CONFIG_SOURCE_ORDINAL
public static final int DEFAULT_CONFIG_SOURCE_ORDINALBy default, test config properties take precedence over system properties (400), ENV variables (300) and application.properties (250)
-
-
Constructor Details
-
QuarkusComponentTestExtensionBuilder
public QuarkusComponentTestExtensionBuilder()
-
-
Method Details
-
addComponentClasses
The initial set of components under test is derived from the test class. The types of all fields annotated withInjectare considered the component types.- Parameters:
componentClasses-- Returns:
- self
- See Also:
-
configProperty
Set a configuration property for the test.- Parameters:
key-value-- Returns:
- self
-
useDefaultConfigProperties
Use the default values for missing config properties. By default, a missing config property results in a test failure.For primitives the default values as defined in the JLS are used. For any other type
nullis injected.- Returns:
- self
-
ignoreNestedClasses
Ignore the static nested classes declared on the test class.By default, all static nested classes declared on the test class are added to the set of additional components under test.
- Returns:
- self
-
setConfigSourceOrdinal
Set the ordinal of the config source used for all test config properties. By default, 500 is used.- Parameters:
val-- Returns:
- self
-
addAnnotationsTransformer
public QuarkusComponentTestExtensionBuilder addAnnotationsTransformer(AnnotationsTransformer transformer) Add an additionalAnnotationsTransformer.- Parameters:
transformer-- Returns:
- self
-
mock
Configure a new mock of a bean.Note that a mock is created automatically for all unsatisfied dependencies in the test. This API provides full control over the bean attributes. The default values are derived from the bean class.
- Parameters:
beanClass-- Returns:
- a new mock bean configurator
- See Also:
-
build
- Returns:
- a new extension instance
-
registerMockBean
-