From 4a23e8c60073e83f7944b751b175b0c1a270c5a7 Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Tue, 24 Nov 2026 13:41:03 +0000 Subject: [PATCH 1/2] Add junit6 module. Fix junit5 upgrade --- .github/dependabot.yml | 3 ++ README.md | 10 +++++ junit5/pom.xml | 2 + junit6/pom.xml | 97 ++++++++++++++++++++++++++++++++++++++++++ pom.xml | 6 +-- quarkus/pom.xml | 5 --- 6 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 junit6/pom.xml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 384b8b8..dcd0db2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,6 +23,9 @@ updates: update-types: ["version-update:semver-major", "version-update:semver-minor"] - dependency-name: "io.undertow:*" update-types: ["version-update:semver-major", "version-update:semver-minor"] + # junit5 module stays on JUnit 5, the junit6 module covers JUnit 6 + - dependency-name: "org.junit.jupiter:*" + update-types: ["version-update:semver-major"] - package-ecosystem: "github-actions" # Also update Github actions directory: "/" schedule: diff --git a/README.md b/README.md index 099e33d..2fb82f8 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,16 @@ or: } } +#### Choosing the artifact + +| Test framework | Artifact | Java | +|---|---|---| +| JUnit 4 | `http-testserver-junit4` | 11+ | +| JUnit 5 | `http-testserver-junit5` (built against JUnit Jupiter 5.14.x) | 11+ | +| JUnit 6 | `http-testserver-junit6` (built against JUnit Jupiter 6.x) | 17+ | + +The JUnit 5 and 6 artifacts expose the same classes in the same `org.commonjava.test.http.junit5` package, so switching only requires changing the artifactId. + #### Quarkus Based Test There are some limitations to let junit5 @ExtendWith work together with @QuarkusTest, see https://github.com/quarkusio/quarkus/issues/24911#issuecomment-1098935690 diff --git a/junit5/pom.xml b/junit5/pom.xml index 5715692..0cd57e2 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -37,6 +37,8 @@ org.junit.jupiter junit-jupiter + + 5.14.4 compile diff --git a/junit6/pom.xml b/junit6/pom.xml new file mode 100644 index 0000000..3deac41 --- /dev/null +++ b/junit6/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + + org.commonjava.util + http-testserver-parent + 2.3.6-SNAPSHOT + ../pom.xml + + + http-testserver-junit6 + http-testserver-junit6 + jar + + + + 17 + + + + + org.commonjava.util + http-testserver-core + + + org.junit.jupiter + junit-jupiter + 6.1.3 + compile + + + org.hamcrest + hamcrest + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + add-junit5-sources + generate-sources + + add-source + + + + ${project.basedir}/../junit5/src/main/java + + + + + add-junit5-test-sources + generate-test-sources + + add-test-source + + + + ${project.basedir}/../junit5/src/test/java + + + + + + + + + diff --git a/pom.xml b/pom.xml index fdfa785..7dabe6b 100644 --- a/pom.xml +++ b/pom.xml @@ -75,11 +75,6 @@ junit 4.13.2 - - org.junit.jupiter - junit-jupiter - 6.1.3 - org.hamcrest hamcrest @@ -97,6 +92,7 @@ core junit4 junit5 + junit6 quarkus diff --git a/quarkus/pom.xml b/quarkus/pom.xml index 1a4b63f..7bd4658 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -50,11 +50,6 @@ org.commonjava.util http-testserver-core - - org.junit.jupiter - junit-jupiter - compile - io.quarkus quarkus-junit5 From 042488ef17ce1c070935ae1acde81760a871ec7a Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Tue, 24 Nov 2026 15:41:58 +0000 Subject: [PATCH 2/2] Use latest SHA for maven-release --- .github/workflows/maven-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 4ef1ff0..ac9e78e 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -13,7 +13,7 @@ jobs: call-release-job: permissions: contents: write # needed to push commit and tag back to the repository - uses: project-ncl/shared-github-actions/.github/workflows/maven-release.yml@af62bc3c8181df77581ddf64859f9bba9129fcad # v0.0.28 + uses: project-ncl/shared-github-actions/.github/workflows/maven-release.yml@fbfd6ad4b1b569f0f4667f5cc71259506dbcb933 # main with: java_version: "17" ref_to_release: ${{ inputs.ref_to_release }}