Skip to content

test: migrate s3 extension tests to JUnit 5 - #19880

Merged
FrankChen021 merged 6 commits into
apache:masterfrom
FrankChen021:codex/junit5-migration-ext-core-6
Aug 5, 2026
Merged

test: migrate s3 extension tests to JUnit 5#19880
FrankChen021 merged 6 commits into
apache:masterfrom
FrankChen021:codex/junit5-migration-ext-core-6

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Description

Migrates the extensions-core/s3-extensions test suite from JUnit 4 to JUnit 5.

This is Batch 6 of the extensions-core migration and is part of #13948.

Depends on the earlier migration batches in #19875, #19876, #19877, #19878, and #19879.

The migration replaces JUnit 4 assertions, rules, and lifecycle methods with Jupiter equivalents, including @TempDir and assertThrows.

Tests

mvn -ntp test -pl extensions-core/s3-extensions -am \
  -Dtest='org.apache.druid.catalog.model.table.S3InputSourceDefnTest,org.apache.druid.data.input.s3.**,org.apache.druid.storage.s3.**' \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -Pskip-static-checks -Dweb.console.skip=true -T1C

Result: 235 tests passed; 0 failures, errors, or skips.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1
Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

Reviewed 27 of 27 changed files.


This is an automated review by Codex GPT-5.6-Sol

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the updated code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 27 of 27 changed files. The prior lifecycle finding is resolved: setUpStatic() now runs under @BeforeAll; the other incremental cleanup is safe.


This is an automated review by Codex GPT-5.6-Sol

@FrankChen021
FrankChen021 marked this pull request as ready for review August 5, 2026 01:54
Copilot AI lite review requested due to automatic review settings August 5, 2026 01:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the extensions-core/s3-extensions test suite from JUnit 4 to JUnit 5 (Jupiter), aligning this module with the ongoing extensions-core JUnit5 migration effort (#13948).

Changes:

  • Replaced JUnit 4 assertions and lifecycle annotations with JUnit Jupiter equivalents (Assertions, @BeforeEach, @BeforeAll).
  • Replaced JUnit 4 rules (TemporaryFolder, ExpectedException, @RunWith) with Jupiter mechanisms (@TempDir, assertThrows, @ExtendWith).
  • Updated the module POM to drop junit:junit and add the Jupiter engine dependency needed to execute JUnit 5 tests.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/TestFileSessionCredentialsProvider.java Switches to Jupiter assertions and @TempDir temp-directory handling.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/TestAWSCredentialsProvider.java Migrates assertions and temp-file handling to JUnit 5.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3Test.java Migrates lifecycle (@BeforeEach), assertions, and temp-file creation to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3UtilsTest.java Replaces JUnit 4 Assert with Jupiter Assertions (including assertThrows).
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3TransferConfigTest.java Simple assertion migration to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3TimestampVersionedDataFinderTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3TaskLogsTest.java Migrates from EasyMockRunner to EasyMockExtension, plus @TempDir and Jupiter assertions.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3StorageDruidModuleTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3StorageConnectorProviderTest.java Migrates assertions and exception assertions to Jupiter idioms.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3InputDataConfigTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentPusherTest.java Migrates to Jupiter assertions and replaces TemporaryFolder with @TempDir.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentPusherConfigTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentPullerTest.java Migrates assertions and temp-dir/file handling to Jupiter + FileUtils helpers.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentMoverTest.java Replaces JUnit4 expected-exception annotation usage with Jupiter assertThrows.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentKillerTest.java Migrates from EasyMockRunner to EasyMockExtension, plus Jupiter assertions.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/S3DataSegmentArchiverTest.java Migrates @BeforeClass to @BeforeAll and assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/S3UploadManagerTest.java Migrates lifecycle annotations, @TempDir, and assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/S3OutputSerdeTest.java Replaces ExpectedException rule with Jupiter assertThrows + message checks.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/S3OutputConfigTest.java Replaces JUnit4 rules with @TempDir and Jupiter exception assertions.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/S3ExportStorageProviderTest.java Migrates assertions to Jupiter and replaces exception expectations with assertThrows.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/output/RetryableS3OutputStreamTest.java Migrates lifecycle, @TempDir, and assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/storage/s3/ObjectSummaryIteratorTest.java Migrates assertions to Jupiter, preserving assertion message semantics.
extensions-core/s3-extensions/src/test/java/org/apache/druid/data/input/s3/S3InputSourceTest.java Migrates from rules/ExpectedException to @TempDir + assertThrows patterns.
extensions-core/s3-extensions/src/test/java/org/apache/druid/data/input/s3/S3InputSourceFactoryTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/data/input/s3/S3InputSourceConfigTest.java Migrates assertions to Jupiter.
extensions-core/s3-extensions/src/test/java/org/apache/druid/catalog/model/table/S3InputSourceDefnTest.java Migrates lifecycle (@BeforeEach) and static assertions to Jupiter.
extensions-core/s3-extensions/pom.xml Removes JUnit 4 dependency and adds junit-jupiter-engine for running Jupiter tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@FrankChen021
FrankChen021 merged commit 6759ebb into apache:master Aug 5, 2026
28 checks passed
@FrankChen021
FrankChen021 deleted the codex/junit5-migration-ext-core-6 branch August 5, 2026 11:47
@github-actions github-actions Bot added this to the 39.0.0 milestone Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants