NopeCharon opened a new pull request, #3878:
URL: https://github.com/apache/parquet-java/pull/3878
### Rationale for this change
`TestFooterIntegrity`, added in #3655, uses JUnit 4 (`org.junit.Test`,
`Assert.assertFalse`, `Assert.assertThrows`). The
`enforce-banned-junit4-imports` enforcer rule rejects those imports in
`process-test-sources`, so `parquet-hadoop` and every module built after it
fail on master before any test runs. The `CI Hadoop 3` workflow has failed on
master since ccbc37a9.
### What changes are included in this PR?
Migrate `TestFooterIntegrity` to JUnit 5 and AssertJ, following
`agents/docs/writing-tests.md`:
- `org.junit.Test` → `org.junit.jupiter.api.Test`
- `assertFalse(metaData.getBlocks().isEmpty())` →
`assertThat(metaData.getBlocks()).isNotEmpty()`
- `assertThrows(TagVerificationException.class, ...)` →
`assertThatThrownBy(...).isInstanceOf(TagVerificationException.class).hasMessage("Signature
mismatch in plaintext footer")`. The message check confirms the footer
signature check is what rejects the file.
The test still covers the same behavior.
### Are these changes tested?
Yes, on JDK 17 with Thrift 0.25.0:
- `./mvnw -pl parquet-hadoop spotless:check test
-Dtest=TestFooterIntegrity`: both tests pass, and the banned-imports rule
passes.
- `./mvnw install -DskipTests` across the whole default reactor: succeeds.
On master it fails in `parquet-hadoop` with `Banned imports detected in TEST
code ... TestFooterIntegrity.java`.
### Are there any user-facing changes?
No. Only a test changes.
--
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]