Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 44 additions & 13 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<db2-jdbc.version>12.1.0.0</db2-jdbc.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<hamcrest.version>2.2</hamcrest.version><!-- The version needs to be compatible with both REST Assured and Awaitility -->
<junit.jupiter.version>5.13.4</junit.jupiter.version>
<junit.jupiter.version>6.0.1</junit.jupiter.version>
<infinispan.version>16.0.2</infinispan.version>
<infinispan.protostream.version>6.0.1</infinispan.protostream.version>
<caffeine.version>3.2.3</caffeine.version>
Expand Down Expand Up @@ -382,7 +382,7 @@
<scope>import</scope>
</dependency>

<!-- JUnit 5 dependencies, imported as a BOM -->
<!-- JUnit Jupiter dependencies, imported as a BOM -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
Expand Down Expand Up @@ -3515,57 +3515,57 @@
<!-- Quarkus test dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<artifactId>quarkus-junit-jupiter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-config</artifactId>
<artifactId>quarkus-junit-jupiter-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-security</artifactId>
<artifactId>quarkus-junit-jupiter-component</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-security-jwt</artifactId>
<artifactId>quarkus-junit-jupiter-internal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-security-oidc</artifactId>
<artifactId>quarkus-junit-jupiter-mockito</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-security-webauthn</artifactId>
<artifactId>quarkus-junit-jupiter-mockito-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-component</artifactId>
<artifactId>quarkus-test-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<artifactId>quarkus-test-security</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-common</artifactId>
<artifactId>quarkus-test-security-jwt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<artifactId>quarkus-test-security-oidc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito-config</artifactId>
<artifactId>quarkus-test-security-webauthn</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -6604,6 +6604,37 @@
<artifactId>quarkus-vertx-http-dev-ui-spi</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-component</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito-config</artifactId>
<version>${project.version}</version>
</dependency>
<!-- End of Relocations, please put new extensions above this list -->

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<opensearch-server.version>3.1.0</opensearch-server.version>
<opensearch.image>docker.io/opensearchproject/opensearch:${opensearch-server.version}</opensearch.image>
<opensearch.protocol>http</opensearch.protocol>
<junit-pioneer.version>2.2.0</junit-pioneer.version>
<junit-pioneer.version>2.3.0</junit-pioneer.version>

<!-- Database images for JDBC/Reactive/Hibernate tests and devservices -->
<postgres.image>docker.io/library/postgres:17</postgres.image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ private DiscoveryResult discoverTestClasses() {
// This is fine, and usually just means that test-framework/junit5 isn't one of the project dependencies
// In that case, fallback to loading classes as we normally would, using a TCCL
log.debug(
"Could not load class for FacadeClassLoader. This might be because quarkus-junit5 is not on the project classpath: "
"Could not load class for FacadeClassLoader. This might be because quarkus-junit-jupiter is not on the project classpath: "
+ e);
log.debug(e);
classLoaderForLoadingTests = Thread.currentThread()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface TestConfig {
* The FQCN of the JUnit <code>ClassOrderer</code> to use. If the class cannot be found, it fallbacks to JUnit
* default behaviour which does not set a <code>ClassOrderer</code> at all.
*
* @see <a href=https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-execution-order-classes>JUnit Class
* @see <a href=https://docs.junit.org/current/user-guide/#writing-tests-test-execution-order-classes>JUnit Class
* Order<a/>
*/
@WithDefault("io.quarkus.test.junit.util.QuarkusTestProfileAwareClassOrderer")
Expand All @@ -55,7 +55,7 @@ public interface TestConfig {
/**
* Tags that should be included for continuous testing. This supports JUnit Tag Expressions.
*
* @see <a href="https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions">JUnit Tag Expressions</a>
* @see <a href="https://docs.junit.org/current/user-guide/#running-tests-tag-expressions">JUnit Tag Expressions</a>
*/
Optional<List<String>> includeTags();

Expand All @@ -68,7 +68,7 @@ public interface TestConfig {
* <p>
* This supports JUnit Tag Expressions.
*
* @see <a href="https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions">JUnit Tag Expressions</a>
* @see <a href="https://docs.junit.org/current/user-guide/#running-tests-tag-expressions">JUnit Tag Expressions</a>
*/
@WithDefault("slow")
Optional<List<String>> excludeTags();
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
<parentFirstArtifact>io.quarkus:quarkus-class-change-agent</parentFirstArtifact>
<parentFirstArtifact>org.jacoco:org.jacoco.agent:runtime</parentFirstArtifact>
<parentFirstArtifact>io.quarkus:quarkus-bootstrap-gradle-resolver</parentFirstArtifact>
<parentFirstArtifact>io.quarkus:quarkus-junit5-mockito-config</parentFirstArtifact>
<parentFirstArtifact>io.quarkus:quarkus-junit-jupiter-mockito-config</parentFirstArtifact>

<!-- Load the junit engine parent first, so it is shared between the outer dev mode
process and the test application-->
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugin-publish = "2.0.0"
kotlin = "2.2.21"
smallrye-config = "3.14.1"

junit5 = "5.13.4"
junit5 = "6.0.1"
assertj = "3.27.6"

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<artifactId>quarkus-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<!-- Minimal test dependencies for consistent build order -->
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/aws-lambda.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ dependencies {
implementation 'io.quarkus:quarkus-resteasy'
implementation 'io.quarkus:quarkus-amazon-lambda'
testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.quarkus:quarkus-junit-jupiter'
testImplementation 'io.rest-assured:rest-assured'
}
----
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/building-my-first-extension.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Let's have a look at the deployment's `./greeting-extension/deployment/pom.xml`.
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<artifactId>quarkus-junit-jupiter-internal</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -460,7 +460,7 @@ dependencies {
implementation platform("io.quarkus:quarkus-bom:${quarkus.version}")
testImplementation 'io.quarkus:quarkus-junit5-internal'
testImplementation 'io.quarkus:quarkus-junit-jupiter-internal'
}
----

Expand Down Expand Up @@ -666,7 +666,7 @@ Now, Quarkus will process this new task which will result in the bytecode genera
When developing a Quarkus extension, you mainly want to test your feature is properly deployed in an application and works as expected.
That's why the tests will be hosted in the `deployment` module.

Quarkus proposes facilities to test extensions via the `quarkus-junit5-internal` artifact (which should already be in the deployment pom.xml), in particular the `io.quarkus.test.QuarkusUnitTest` runner which starts an application with your extension.
Quarkus proposes facilities to test extensions via the `quarkus-junit-jupiter-internal` artifact (which should already be in the deployment pom.xml), in particular the `io.quarkus.test.QuarkusUnitTest` runner which starts an application with your extension.

We will use https://rest-assured.io[RestAssured] (massively used in Quarkus) to test our HTTP endpoint.
Let's add the `rest-assured` dependency into the `./greeting-extension/deployment/pom.xml`.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/doc-contribute-docs-howto.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ Our builds use https://vale.sh[Vale] to check grammar, style, and word usage in

This approach requires a working container runtime (Docker or xref:podman.adoc[Podman]).

The `docs` module has a JUnit 5 test that will run the Vale linter in a container (using https://www.testcontainers.org/[Testcontainers]).
The `docs` module has a JUnit Jupiter test that will run the Vale linter in a container (using https://www.testcontainers.org/[Testcontainers]).
It verifies both Quarkus document metadata and Vale style rules.

Run the test in one of the following ways:
Expand Down
26 changes: 13 additions & 13 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ In your build file you should see 2 test dependencies:
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<artifactId>quarkus-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -73,18 +73,18 @@ In your build file you should see 2 test dependencies:
[source,groovy,subs=attributes+]
----
dependencies {
testImplementation("io.quarkus:quarkus-junit5")
testImplementation("io.quarkus:quarkus-junit-jupiter")
testImplementation("io.rest-assured:rest-assured")
}
----
****

`quarkus-junit5` is required for testing, as it provides the `@QuarkusTest` annotation that controls the testing framework.
`quarkus-junit-jupiter` is required for testing, as it provides the `@QuarkusTest` annotation that controls the testing framework.
`rest-assured` is not required but is a convenient way to test HTTP endpoints, we also provide integration that automatically
sets the correct URL so no configuration is required.

Because we are using JUnit 5, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin]
must be set, as the default version does not support Junit 5:
Because we are using JUnit Jupiter, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin]
must be set, as the default version does not support JUnit Jupiter:

[source,xml,subs=attributes+]
----
Expand Down Expand Up @@ -470,11 +470,11 @@ a bit slower, as it adds a shutdown/startup cycle to the test time, but gives a

To reduce the amount of times Quarkus needs to restart, `io.quarkus.test.junit.util.QuarkusTestProfileAwareClassOrderer`
is registered as a global `ClassOrderer` as described in the
link:https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-execution-order-classes[JUnit 5 User Guide].
link:https://docs.junit.org/current/user-guide/#writing-tests-test-execution-order-classes[JUnit Jupiter User Guide].
The behavior of this `ClassOrderer` is configurable via `application.properties` using the property
`quarkus.test.class-orderer`. The property accepts the FQCN of the `ClassOrderer` to use. If the class cannot be found,
it fallbacks to JUnit default behaviour which does not set a `ClassOrderer` at all. It can also be disabled entirely by
setting another `ClassOrderer` that is provided by JUnit 5 or even your own custom one.
setting another `ClassOrderer` that is provided by JUnit Jupiter or even your own custom one.

=== Writing a Profile

Expand Down Expand Up @@ -704,7 +704,7 @@ matches the value of `quarkus.test.profile.tags`.

== Nested Tests

JUnit 5 https://junit.org/junit5/docs/current/user-guide/#writing-tests-nested[@Nested tests] are useful for structuring more complex test scenarios.
JUnit Jupiter https://docs.junit.org/current/user-guide/#writing-tests-nested[@Nested tests] are useful for structuring more complex test scenarios.
However, note that it is not possible to assign different test profiles or resources to nested tests within the same parent class.

== Mock Support
Expand Down Expand Up @@ -836,12 +836,12 @@ Building on the features provided by `QuarkusMock`, Quarkus also allows users to

[IMPORTANT]
====
This functionality is available with the `@io.quarkus.test.InjectMock` annotation **only if** the `quarkus-junit5-mockito` dependency is present:
This functionality is available with the `@io.quarkus.test.InjectMock` annotation **only if** the `quarkus-junit-jupiter-mockito` dependency is present:
[source,xml]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<artifactId>quarkus-junit-jupiter-mockito</artifactId>
<scope>test</scope>
</dependency>
----
Expand Down Expand Up @@ -958,7 +958,7 @@ This is considered an advanced option and should only be performed if you fully
==== Using Spies instead of Mocks with `@InjectSpy`

Building on the features provided by `InjectMock`, Quarkus also allows users to effortlessly take advantage of link:https://site.mockito.org/[Mockito] for spying on the beans supported by `QuarkusMock`.
This functionality is available via the `@io.quarkus.test.junit.mockito.InjectSpy` annotation which is available in the `quarkus-junit5-mockito` dependency.
This functionality is available via the `@io.quarkus.test.junit.mockito.InjectSpy` annotation which is available in the `quarkus-junit-jupiter-mockito` dependency.

Sometimes when testing you only need to verify that a certain logical path was taken, or you only need to stub out a single method's response while still executing the rest of the methods on the Spied clone. Please see link:https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#13[Mockito documentation - Spying on real objects] for more details on Spy partial mocks.
In either of those situations a Spy of the object is preferable.
Expand Down Expand Up @@ -1484,7 +1484,7 @@ while the latter three can coexist.
The reason of this restriction is that `@QuarkusTest` starts a Quarkus server for the whole lifetime of the tests execution run,
thus preventing the other tests to start their own Quarkus server.

To alleviate this restriction, the `@QuarkusTest` annotation defines a JUnit 5 `@Tag`: `io.quarkus.test.junit.QuarkusTest`.
To alleviate this restriction, the `@QuarkusTest` annotation defines a JUnit Jupiter `@Tag`: `io.quarkus.test.junit.QuarkusTest`.
You can use this tag to isolate the `@QuarkusTest` test in a specific execution run, for example with the Maven Surefire Plugin:

[source,xml]
Expand Down Expand Up @@ -1699,7 +1699,7 @@ public @interface QuarkusSecurityTest { <1>
== Testing Components

Quarkus provides the `QuarkusComponentTestExtension`, a JUnit extension to ease the testing of components and mocking of their dependencies.
This JUnit extension is available in the `quarkus-junit5-component` dependency.
This JUnit extension is available in the `quarkus-junit-jupiter-component` dependency.

Let's have a component `Foo` - a CDI bean with two injection points.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ In the generated build file, you can see 2 test dependencies:
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<artifactId>quarkus-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -326,13 +326,13 @@ In the generated build file, you can see 2 test dependencies:
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
testImplementation("io.quarkus:quarkus-junit5")
testImplementation("io.quarkus:quarkus-junit-jupiter")
testImplementation("io.rest-assured:rest-assured")
----

Quarkus supports https://junit.org/junit5/[JUnit 5] tests.
Quarkus supports https://docs.junit.org/current/user-guide/[JUnit Jupiter] tests.

Because of this, in the case of Maven, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin] must be set, as the default version does not support JUnit 5:
Because of this, in the case of Maven, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin] must be set, as the default version does not support JUnit Jupiter:

[source,xml,subs=attributes+]
----
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/hibernate-orm-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,14 @@ public class PanacheMockingTest {

=== Using the repository pattern

If you are using the repository pattern you can use Mockito directly, using the `quarkus-junit5-mockito` module,
If you are using the repository pattern you can use Mockito directly, using the `quarkus-junit-jupiter-mockito` module,
which makes mocking beans much easier:

[source,xml]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<artifactId>quarkus-junit-jupiter-mockito</artifactId>
<scope>test</scope>
</dependency>
----
Expand Down
Loading
Loading