Package io.quarkus.test.junit
Interface QuarkusTestProfile
- All Known Implementing Classes:
ClassCoercingTestProfile
public interface QuarkusTestProfile
Defines a 'test profile'. Tests run under a test profile
will have different configuration options to other tests.
If an implementation of this interface declares CDI beans, via producer methods/fields and nested static classes, then those beans are only taken into account if this test profile is used. In other words, the beans are ignored for any other test profile.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault String[]The command line parameters that are passed to the main method on startup.default booleanIf this method returns true then allStartupEventandShutdownEventobservers declared on application beans should be disabled.default booleanIf this returns true then only the test resources returned fromtestResources()will be started, global annotated test resources will be ignored.Returns additional config to be applied to the test.default StringAllows the default config profile to be overridden.Returns enabled alternatives.default booleanIf the main method should be run.tags()The tags this profile is associated with.default List<QuarkusTestProfile.TestResourceEntry> AdditionalQuarkusTestResourceLifecycleManagerclasses (along with their init params) to be used from this specific test profile.
-
Method Details
-
getConfigOverrides
Returns additional config to be applied to the test. This will override any existing config (including in application.properties), however existing config will be merged with this (i.e. application.properties config will still take effect, unless a specific config key has been overridden). -
getEnabledAlternatives
Returns enabled alternatives. This has the same effect as setting the 'quarkus.arc.selected-alternatives' config key, however it may be more convenient. -
getConfigProfile
Allows the default config profile to be overridden. This basically just sets the quarkus.test.profile system property before the test is run. -
testResources
AdditionalQuarkusTestResourceLifecycleManagerclasses (along with their init params) to be used from this specific test profile. If this method is not overridden, then only theQuarkusTestResourceLifecycleManagerclasses enabled via theQuarkusTestResourceclass annotation will be used for the tests using this profile (which is the same behavior as tests that don't use a profile at all). -
disableGlobalTestResources
default boolean disableGlobalTestResources()If this returns true then only the test resources returned fromtestResources()will be started, global annotated test resources will be ignored. -
tags
The tags this profile is associated with. When thequarkus.test.profile.tagsSystem property is set (its value is a comma separated list of strings) then Quarkus will only execute tests that are annotated with a@TestProfilethat has at least one of the supplied (via the aforementioned system property) tags. -
commandLineParameters
The command line parameters that are passed to the main method on startup. This is ignored forQuarkusMainTest, which has its own way of passing parameters. -
runMainMethod
default boolean runMainMethod()If the main method should be run. This is ignored forQuarkusMainTest, where the main method is always run. -
disableApplicationLifecycleObservers
default boolean disableApplicationLifecycleObservers()If this method returns true then allStartupEventandShutdownEventobservers declared on application beans should be disabled.
-