Package io.quarkus.test.junit
Interface QuarkusTestProfile
-
public interface QuarkusTestProfile
Defines a 'test profile'. Tests run under a test profile will have different configuration options to other tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
QuarkusTestProfile.TestResourceEntry
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default String[]
commandLineParameters()
The command line parameters that are passed to the main method on startup.default boolean
disableApplicationLifecycleObservers()
If this method returns true then allStartupEvent
andShutdownEvent
observers declared on application beans should be disabled.default boolean
disableGlobalTestResources()
If this is returns true then only the test resources returned fromtestResources()
will be started, global annotated test resources will be ignored.default Map<String,String>
getConfigOverrides()
Returns additional config to be applied to the test.default String
getConfigProfile()
Allows the default config profile to be overridden.default Set<Class<?>>
getEnabledAlternatives()
Returns enabled alternatives.default boolean
runMainMethod()
If the main method should be run.default Set<String>
tags()
The tags this profile is associated with.default List<QuarkusTestProfile.TestResourceEntry>
testResources()
AdditionalQuarkusTestResourceLifecycleManager
classes (along with their init params) to be used from this specific test profile.
-
-
-
Method Detail
-
getConfigOverrides
default Map<String,String> 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
default Set<Class<?>> 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
default String 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
default List<QuarkusTestProfile.TestResourceEntry> testResources()
AdditionalQuarkusTestResourceLifecycleManager
classes (along with their init params) to be used from this specific test profile. If this method is not overridden, then only theQuarkusTestResourceLifecycleManager
classes enabled via theQuarkusTestResource
class 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 is returns true then only the test resources returned fromtestResources()
will be started, global annotated test resources will be ignored.
-
tags
default Set<String> tags()
The tags this profile is associated with. When thequarkus.test.profile.tags
System property is set (its value is a comma separated list of strings) then Quarkus will only execute tests that are annotated with a@TestProfile
that has at least one of the supplied (via the aforementioned system property) tags.
-
commandLineParameters
default String[] 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 allStartupEvent
andShutdownEvent
observers declared on application beans should be disabled.
-
-