Files
java-testing-lab/junit-6-migration/README.md
T

34 lines
1.6 KiB
Markdown

# junit-6-migration
Companion module for the ankurm.com article on **migrating from JUnit 5 to JUnit 6**. The same tests run on JUnit 5.14.4 and 6.1.3, and the two
releases are compared jar against jar. Nothing here is copied from release notes: each file in `output/` was produced by running something.
## Versions
| Component | Version | Notes |
|---|---|---|
| JUnit (before) | `5.14.4` Jupiter / `1.14.4` Platform | last 5.x release on Maven Central at the time of writing |
| JUnit (after) | `6.1.3` | Jupiter, Platform and Vintage all share this one number |
| JUnit 4 | `4.13.2` | only for the Vintage check |
| Java | build on `25`, `--release 17` | JUnit 6 jars need Java 17 |
## Run
```bash
./scripts/run-all.sh
```
## Output
| File | What it shows |
|---|---|
| `01-versions-and-baseline.txt` | version numbers and the Java level of each jar's class files |
| `02-removed-api.txt` | public classes and members in 5.14.4 that are not in 6.1.3, and whether 5.14.4 had deprecated them |
| `03-csv-behaviour-<version>.txt` | one set of `@CsvSource` and `@CsvFileSource` cases run on each version |
| `04-vintage-junit4-<version>.txt` | a JUnit 4 test run through the Vintage engine on each version |
| `05-old-apis-<version>.txt` | what the compiler says about three deprecated 5.x APIs on each version |
| `06-fixed-apis-<version>.txt` | the replacements compile on both versions |
| `07-jar-contents.txt` | which CSV parser each `junit-jupiter-params` jar bundles, and the Vintage engine's declared status |
`pom.xml` has two profiles, `junit5` and `junit6`, that change nothing but `junit.version`.