lintingbin opened a new pull request, #4199:
URL: https://github.com/apache/amoro/pull/4199

   ## What is this PR for?
   
   Closes part of #3974.
   
   Replaces JUnit 4 (`org.junit.*`) imports with JUnit 5 
(`org.junit.jupiter.api.*`) in the self-contained unit tests of the 
`amoro-common` module:
   
   - `TestLocalExecutionEngine`
   - `TestSimpleFuture`
   - `JacksonUtilTest`
   - `MemorySizeTest`
   - `TestPoolConfig`
   - `MockZookeeperServer`
   
   `@Test(expected=...)` is replaced by `Assertions.assertThrows(...)`. 
`@Before`/`@After` become `@BeforeEach`/`@AfterEach`. JUnit 4's 
`Assert.assertX("msg", expected, actual)` is rewritten as JUnit 5's 
`Assertions.assertX(expected, actual, "msg")`. `MemorySizeTest` previously used 
Hamcrest `assertThat(x, is(y))` (pulled in transitively by JUnit 4); those 
checks are rewritten with `Assertions.assertEquals`.
   
   ## What is the limitation?
   
   This PR is intentionally scoped: shared test bases and rule helpers in 
`amoro-common` are **not** migrated, because they are still extended (or 
referenced as `@Rule`/`@ClassRule`) by JUnit 4 tests in other modules. 
Migrating them in isolation would break those modules. The remaining files are:
   
   - `TestAms` (extends `org.junit.rules.ExternalResource`) — used as 
`@Rule`/`@ClassRule` in `amoro-ams`, `amoro-format-iceberg`, 
`amoro-format-mixed`, `amoro-format-paimon`, `amoro-optimizer-common`, 
`amoro-openapi-sdk`.
   - `TestHMS` (extends `ExternalResource`, owns a JUnit 4 `TemporaryFolder`) — 
same situation.
   - `AmoroCatalogTestBase` and `TestAmoroCatalogBase` — abstract bases 
extended by `TestIcebergAmoroCatalog`, `TestMixedIcebergFormatCatalog`, 
`TestPaimonAmoroCatalog`, etc. that use `@RunWith(Parameterized.class)`.
   - `TestServerTableDescriptor` — abstract base extended by 
`TestIcebergServerTableDescriptor` and `TestPaimonServerTableDescriptor`, both 
using `@RunWith(Parameterized.class)`.
   - `AmoroRunListener` (extends `org.junit.runner.notification.RunListener`) — 
wired into the surefire `<properties>` of `amoro-mixed-flink-common` as a JUnit 
4 listener.
   
   These will be migrated together with their consumers in a follow-up so the 
`junit:junit` dependency can be dropped from the parent POM.
   
   ## Type of change
   
   - [x] Improvement (test infrastructure)
   
   ## How was this patch tested?
   
   `./mvnw -pl amoro-common test` — all 96 tests pass under the JUnit Platform 
provider.


-- 
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]

Reply via email to