Class QuarkusComponentTestExtensionBuilder

    • Field Detail

      • DEFAULT_CONFIG_SOURCE_ORDINAL

        public static final int DEFAULT_CONFIG_SOURCE_ORDINAL
        By default, test config properties take precedence over system properties (400), ENV variables (300) and application.properties (250)
        See Also:
        setConfigSourceOrdinal(int), Constant Field Values
    • Constructor Detail

      • QuarkusComponentTestExtensionBuilder

        public QuarkusComponentTestExtensionBuilder()
    • Method Detail

      • addComponentClasses

        public QuarkusComponentTestExtensionBuilder addComponentClasses​(Class<?>... componentClasses)
        The initial set of components under test is derived from the test class. The types of all fields annotated with Inject are considered the component types.
        Parameters:
        componentClasses -
        Returns:
        self
        See Also:
        ignoreNestedClasses()
      • useDefaultConfigProperties

        public QuarkusComponentTestExtensionBuilder 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 null is injected.

        Returns:
        self
      • ignoreNestedClasses

        public QuarkusComponentTestExtensionBuilder 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

        public QuarkusComponentTestExtensionBuilder setConfigSourceOrdinal​(int val)
        Set the ordinal of the config source used for all test config properties. By default, 500 is used.
        Parameters:
        val -
        Returns:
        self
      • mock

        public <T> MockBeanConfigurator<T> mock​(Class<T> beanClass)
        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:
        MockBeanConfigurator.create(Function)