Skip to content

[Improvement]: Remove JUnit 4 from the repository #4203

@lintingbin

Description

@lintingbin

Search before asking

  • I have searched in the issues and found no similar issues.

What would you like to be improved?

Remove JUnit 4 (org.junit.*) from the entire repository so the parent POM can drop junit:junit and junit-vintage-engine. Currently ~246 test files still depend on JUnit 4, including ~89 @RunWith(Parameterized.class) classes.

This issue tracks the umbrella effort across all modules. The original #3974 was scoped only to amoro-common, but the shared test bases there (TestAms, TestHMS, AmoroCatalogTestBase, TestAmoroCatalogBase, TestServerTableDescriptor, AmoroRunListener) are extended or used as @Rule/@ClassRule/RunListener by tests in many other modules. Migrating those bases in isolation breaks downstream modules — that is what blocked #4004 and #4059. So the migration has to happen across all modules in coordinated steps and needs a single umbrella ticket to track ordering.

How should we improve?

Strategy: leaves first, root last — migrate concrete test classes module by module, keeping the shared amoro-common helpers on JUnit 4 until every consumer is gone. CI stays green at every step. Each step is a separate PR with body Closes part of #THIS_ISSUE.

Notes on the Parameterized rewrite

Subclasses such as TestIcebergAmoroCatalog, TestMixedIcebergFormatCatalog, and TestPaimonAmoroCatalog currently use @RunWith(Parameterized.class) with constructor injection of AmoroCatalogTestHelper. JUnit 5 has no equivalent of constructor parameter injection without a custom ParameterResolver. Per @czy006's preference expressed on #4004, these will be refactored to @ParameterizedTest + @MethodSource rather than registering a ParameterResolver — the latter would be carry-over tech debt.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions