Package io.quarkus.test
Class QuarkusUnitTest
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension,org.junit.jupiter.api.extension.InvocationInterceptor,org.junit.jupiter.api.extension.ParameterResolver,org.junit.jupiter.api.extension.TestInstantiationAwareExtension
@Deprecated(since="3.35",
forRemoval=true)
public class QuarkusUnitTest
extends AbstractQuarkusExtensionTest<QuarkusUnitTest>
Deprecated, for removal: This API element is subject to removal in a future version.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor
org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope -
Field Summary
Fields inherited from class io.quarkus.test.AbstractQuarkusExtensionTest
started, THE_BUILD_WAS_EXPECTED_TO_FAIL -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.QuarkusUnitTest(boolean useSecureConnection) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalDependency(org.jboss.shrinkwrap.api.spec.JavaArchive archive) Deprecated, for removal: This API element is subject to removal in a future version.Add the java archive as an additional dependency.addBootstrapCustomizer(Consumer<io.quarkus.bootstrap.app.QuarkusBootstrap.Builder> consumer) Deprecated, for removal: This API element is subject to removal in a future version.An advanced option that allows tests to customize theQuarkusBootstrap.Builderthat will be used to create theCuratedApplicationaddBuildChainCustomizer(Consumer<io.quarkus.builder.BuildChainBuilder> customizer) Deprecated, for removal: This API element is subject to removal in a future version.addClassLoaderEventListener(io.quarkus.bootstrap.classloading.ClassLoaderEventListener listener) Deprecated, for removal: This API element is subject to removal in a future version.assertException(Consumer<Throwable> assertException) Deprecated, for removal: This API element is subject to removal in a future version.assertLogRecords(Consumer<List<LogRecord>> assertLogRecords) Deprecated, for removal: This API element is subject to removal in a future version.debugBytecode(boolean debugBytecode) Deprecated, for removal: This API element is subject to removal in a future version.Controls bytecode-related debug dumping.overrideConfigKey(String propertyKey, String propertyValue) Deprecated, for removal: This API element is subject to removal in a future version.Overriden configuration properties take precedence over anapplication.propertiesasset added in the testJavaArchive.overrideRuntimeConfigKey(String propertyKey, String propertyValue) Deprecated, for removal: This API element is subject to removal in a future version.setAfterAllCustomizer(Runnable afterAllCustomizer) Deprecated, for removal: This API element is subject to removal in a future version.setAfterUndeployListener(Runnable afterUndeployListener) Deprecated, for removal: This API element is subject to removal in a future version.setAllowTestClassOutsideDeployment(boolean allowTestClassOutsideDeployment) Deprecated, for removal: This API element is subject to removal in a future version.Normally access to any test classes that are not packaged in the deployment will result in a ClassNotFoundException.setArchiveProducer(Supplier<org.jboss.shrinkwrap.api.spec.JavaArchive> archiveProducer) Deprecated, for removal: This API element is subject to removal in a future version.setBeforeAllCustomizer(Runnable beforeAllCustomizer) Deprecated, for removal: This API element is subject to removal in a future version.setCommandLineParameters(String... commandLineParameters) Deprecated, for removal: This API element is subject to removal in a future version.setExpectedException(Class<? extends Throwable> expectedException) Deprecated, for removal: This API element is subject to removal in a future version.setExpectedException(Class<? extends Throwable> expectedException, boolean logMessage) Deprecated, for removal: This API element is subject to removal in a future version.setFlatClassPath(boolean flatClassPath) Deprecated, for removal: This API element is subject to removal in a future version.If this test should use a single ClassLoader to load all the classes.setForcedDependencies(List<io.quarkus.maven.dependency.Dependency> forcedDependencies) Deprecated, for removal: This API element is subject to removal in a future version.Provides a convenient way to either add additional dependencies to the application (if it doesn't already contain a dependency), or override a version (if the dependency already exists)setLogFileName(String logFileName) Deprecated, for removal: This API element is subject to removal in a future version.setLogRecordPredicate(Predicate<LogRecord> predicate) Deprecated, for removal: This API element is subject to removal in a future version.traceCategories(String... categories) Deprecated, for removal: This API element is subject to removal in a future version.Enables trace logs for the given categories, during both build and runtime.withAdditionalDependency(Consumer<org.jboss.shrinkwrap.api.spec.JavaArchive> dependencyConsumer) Deprecated, for removal: This API element is subject to removal in a future version.Add the java archive as an additional dependency.withApplicationRoot(Consumer<org.jboss.shrinkwrap.api.spec.JavaArchive> applicationRootConsumer) Deprecated, for removal: This API element is subject to removal in a future version.Customize the application root.withConfiguration(String configBlock) Deprecated, for removal: This API element is subject to removal in a future version.Adds build-time configuration properties using a text block.withConfigurationResource(String resourceName) Deprecated, for removal: This API element is subject to removal in a future version.Add anapplication.propertiesasset loaded from the specified resource file in the testJavaArchive.Deprecated, for removal: This API element is subject to removal in a future version.Use an empty application for the testwithRuntimeConfiguration(String configBlock) Deprecated, for removal: This API element is subject to removal in a future version.Adds runtime configuration properties using a text block.static QuarkusUnitTestDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class io.quarkus.test.AbstractQuarkusExtensionTest
afterAll, afterEach, beforeAll, beforeEach, getAfterUndeployListener, getArchiveProducer, getCommandLineParameters, interceptAfterAllMethod, interceptAfterEachMethod, interceptBeforeAllMethod, interceptBeforeEachMethod, interceptTestFactoryMethod, interceptTestMethod, interceptTestTemplateMethod, resolveParameter, setExcludedDependencies, supportsParameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor
interceptDynamicTest, interceptTestClassConstructorMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Constructor Details
-
QuarkusUnitTest
public QuarkusUnitTest()Deprecated, for removal: This API element is subject to removal in a future version. -
QuarkusUnitTest
public QuarkusUnitTest(boolean useSecureConnection) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
withSecuredConnection
Deprecated, for removal: This API element is subject to removal in a future version. -
setArchiveProducer
public QuarkusUnitTest setArchiveProducer(Supplier<org.jboss.shrinkwrap.api.spec.JavaArchive> archiveProducer) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setArchiveProducerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
archiveProducer-- Returns:
- self
- See Also:
-
withApplicationRoot
public QuarkusUnitTest withApplicationRoot(Consumer<org.jboss.shrinkwrap.api.spec.JavaArchive> applicationRootConsumer) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestCustomize the application root.- Overrides:
withApplicationRootin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
applicationRootConsumer-- Returns:
- self
-
withEmptyApplication
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestUse an empty application for the test- Overrides:
withEmptyApplicationin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Returns:
- self
-
overrideConfigKey
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestOverriden configuration properties take precedence over anapplication.propertiesasset added in the testJavaArchive.- Overrides:
overrideConfigKeyin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
propertyKey-propertyValue-- Returns:
- the test configuration
-
overrideRuntimeConfigKey
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
overrideRuntimeConfigKeyin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
withConfigurationResource
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAdd anapplication.propertiesasset loaded from the specified resource file in the testJavaArchive.If an
application.propertiesasset was already added explicitly to the archive (for instance throughResourceContainer.addAsResource(String)), this formet asset is removed and completely replaced by the one given here.Configuration properties added with
AbstractQuarkusExtensionTest.overrideConfigKey(String, String)take precedence over the properties from the specified resource file.- Overrides:
withConfigurationResourcein classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
resourceName-- Returns:
- the test configuration
-
assertException
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
assertExceptionin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setExpectedException
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setExpectedExceptionin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setExpectedException
public QuarkusUnitTest setExpectedException(Class<? extends Throwable> expectedException, boolean logMessage) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setExpectedExceptionin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setForcedDependencies
public QuarkusUnitTest setForcedDependencies(List<io.quarkus.maven.dependency.Dependency> forcedDependencies) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestProvides a convenient way to either add additional dependencies to the application (if it doesn't already contain a dependency), or override a version (if the dependency already exists)- Overrides:
setForcedDependenciesin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
addBuildChainCustomizer
public QuarkusUnitTest addBuildChainCustomizer(Consumer<io.quarkus.builder.BuildChainBuilder> customizer) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
addBuildChainCustomizerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setLogRecordPredicate
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setLogRecordPredicatein classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
assertLogRecords
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
assertLogRecordsin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setLogFileName
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setLogFileNamein classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setBeforeAllCustomizer
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setBeforeAllCustomizerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setAfterAllCustomizer
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setAfterAllCustomizerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setCommandLineParameters
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setCommandLineParametersin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
withAdditionalDependency
public QuarkusUnitTest withAdditionalDependency(Consumer<org.jboss.shrinkwrap.api.spec.JavaArchive> dependencyConsumer) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAdd the java archive as an additional dependency. This dependency is always considered an application archive, even if it would not otherwise be one.- Overrides:
withAdditionalDependencyin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
dependencyConsumer-- Returns:
- self
-
addAdditionalDependency
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAdd the java archive as an additional dependency. This dependency is always considered an application archive, even if it would not otherwise be one.- Overrides:
addAdditionalDependencyin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
archive-- Returns:
- self
-
withConfiguration
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAdds build-time configuration properties using a text block.- Overrides:
withConfigurationin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
configBlock- text block containingkey=valueconfiguration entries
-
withRuntimeConfiguration
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAdds runtime configuration properties using a text block.- Overrides:
withRuntimeConfigurationin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
configBlock- text block containingkey=valueconfiguration entries
-
setFlatClassPath
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestIf this test should use a single ClassLoader to load all the classes. This is sometimes necessary when testing Quarkus itself, and we want the test classes and Quarkus classes to be in the same CL.- Overrides:
setFlatClassPathin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setAllowTestClassOutsideDeployment
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestNormally access to any test classes that are not packaged in the deployment will result in a ClassNotFoundException. If this is true then access is allowed, which can be useful when testing shutdown behaviour.- Overrides:
setAllowTestClassOutsideDeploymentin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
setAfterUndeployListener
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setAfterUndeployListenerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
addClassLoaderEventListener
public QuarkusUnitTest addClassLoaderEventListener(io.quarkus.bootstrap.classloading.ClassLoaderEventListener listener) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
addClassLoaderEventListenerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
addBootstrapCustomizer
public QuarkusUnitTest addBootstrapCustomizer(Consumer<io.quarkus.bootstrap.app.QuarkusBootstrap.Builder> consumer) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestAn advanced option that allows tests to customize theQuarkusBootstrap.Builderthat will be used to create theCuratedApplication- Overrides:
addBootstrapCustomizerin classAbstractQuarkusExtensionTest<QuarkusUnitTest>
-
debugBytecode
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestControls bytecode-related debug dumping.When enabled, each Quarkus startup will have configuration properties such as
quarkus.debug.generated-classes-dirset so that generated code gets dumped intarget/debug, within a unique subdirectory for each test execution.Look at the logs of a particular test to identify the corresponding dump directory.
- Overrides:
debugBytecodein classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
debugBytecode-trueif debug should be enabled- Returns:
this, for method chaining.
-
traceCategories
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractQuarkusExtensionTestEnables trace logs for the given categories, during both build and runtime.- Overrides:
traceCategoriesin classAbstractQuarkusExtensionTest<QuarkusUnitTest>- Parameters:
categories- The categories for which to enable trace logging.- Returns:
this, for method chaining.
-
QuarkusExtensionTest