FrankChen021 opened a new pull request, #19911:
URL: https://github.com/apache/druid/pull/19911
## Summary
- Migrates the server test batch from JUnit 4 to JUnit 5, including
lifecycle, rule, parameterization, and Mockito integrations.
- Replaces Hamcrest assertions and matchers in the server scope with Jupiter
assertions, AssertJ, and server-local JUnit 5 helpers for exception and log
capture.
- Removes unused JUnit 4, Vintage, migration-support, Hamcrest, Jersey
test-framework, and transitive Truth compatibility paths from `server/pom.xml`.
- Moves the server QueryStack group-by factory off the legacy processing
`GroupByQueryRunnerTest`.
- Reconciles the batch with the latest `apache/druid/master`; the complete
diff is limited to `server/**` (411 files).
## Validation
- `mvn -ntp -pl server test-compile -DskipTests -Dweb.console.skip=true` —
passed.
- Checkstyle: 0 violations.
- PMD: passed.
- Enforcer: passed.
- Forbidden APIs: 0 errors in main classes and 0 errors in test classes.
- Targeted server tests — 559 tests, 0 failures, 0 errors, 13 skipped.
- QueryStack consumers `QuerySchedulerTest` (22) and `DirectDruidClientTest`
(12) — passed.
- `mvn -ntp -pl server spotbugs:check -DskipTests -Dweb.console.skip=true` —
passed; 0 BugInstances, 0 errors.
- Effective server test dependency tree — no `junit:junit`, Vintage, JUnit
migration-support, Hamcrest, Jersey test-framework, or Truth artifacts.
- Full server Java audit, including static imports — no JUnit 4 or Hamcrest
imports/usages.
- `./dev/validate-junit5-usage` — passed; server reports `hasj4: 0` and
`hasVintage: 0`.
- `git diff --check` — passed.
## Shared fixture stacking prerequisite
[#19875](https://github.com/apache/druid/pull/19875) currently contains
older copies of:
- `server/src/test/java/org/apache/druid/server/QueryStackTests.java`
- `server/src/test/java/org/apache/druid/metadata/TestDerbyConnector.java`
This PR is the sole owner of the finalized server versions. Before merging
either PR, rebase #19875 to drop those two server paths (or apply the
equivalent stack/rebase ordering); do not retain divergent copies in both PRs.
The server `CachingClusteredClientTest` also consumes
`processing/src/test/java/org/apache/druid/segment/TestHelper.java`. On current
master that shared fixture still calls JUnit 4 `org.junit.Assert`; with the
cleaned server classpath, the test currently fails with `NoClassDefFoundError:
org/junit/Assert` (262 tests attempted, 150 errors). #19875 contains the JUnit
5 processing-fixture migration. After #19875 drops its two older server paths,
its processing fixture changes must land or be stacked/rebased before
`CachingClusteredClientTest` can run. This is the narrow prerequisite; this PR
intentionally retains no JUnit 4/Hamcrest compatibility dependencies.
Part of #13948
Prior migration PRs: [#19875](https://github.com/apache/druid/pull/19875),
[#19876](https://github.com/apache/druid/pull/19876),
[#19877](https://github.com/apache/druid/pull/19877),
[#19878](https://github.com/apache/druid/pull/19878),
[#19879](https://github.com/apache/druid/pull/19879),
[#19880](https://github.com/apache/druid/pull/19880).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]