Skip to content

[FLINK-27941][connectors/aws] Migrate remaining tests to JUnit 5#244

Open
jlalwani-amazon wants to merge 1 commit into
apache:mainfrom
jlalwani-amazon:flink-27941-junit5-migration
Open

[FLINK-27941][connectors/aws] Migrate remaining tests to JUnit 5#244
jlalwani-amazon wants to merge 1 commit into
apache:mainfrom
jlalwani-amazon:flink-27941-junit5-migration

Conversation

@jlalwani-amazon
Copy link
Copy Markdown

@jlalwani-amazon jlalwani-amazon commented Apr 27, 2026

What is the purpose of the change

Complete JUnit 5 migration for the remaining 6 test files in flink-connector-aws (FLINK-27941).

JIRA: FLINK-27941

Brief change log

  • KinesisDynamicTableSourceFactoryTest - import ordering fix
  • GlueSchemaRegistryAvroKinesisITCase - @ClassRule@Container/@Testcontainers, AssumeAssumptions, remove extends TestLogger
  • GlueSchemaRegistryJsonKinesisITCase - import ordering fix (already migrated)
  • SqsSinkITTest - @ClassRule@Container/@Testcontainers, lifecycle annotations, remove extends TestLogger
  • KinesisFirehoseTableITTest - @Rule Timeout@Timeout, @ClassRule@Container/@Testcontainers, remove extends TestLogger
  • KinesisStreamsTableApiIT - @Rule Timeout@Timeout, lifecycle annotations

No test logic changes. Zero JUnit 4 imports remaining after this PR.

Verifying this change

CI passed on fork: https://github.com/jlalwani-amazon/flink-connector-aws/actions

Unit tests (flink-connector-aws-kinesis-streams): 194 tests, 0 failures, 0 errors ✅
Full CI: All jobs green (JDK 11, JDK 17, python tests) ✅

Does this pull request potentially affect one of the following parts?

  • Dependencies: no
  • The public API: no
  • The serializers: no
  • The runtime per-record code paths: no
  • Anything that affects deployment or recovery: no

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 27, 2026

Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)

@jlalwani-amazon jlalwani-amazon marked this pull request as draft April 27, 2026 23:15
@jlalwani-amazon jlalwani-amazon marked this pull request as ready for review April 27, 2026 23:20
@jlalwani-amazon jlalwani-amazon force-pushed the flink-27941-junit5-migration branch from 53c7e9a to b62fb97 Compare May 8, 2026 21:23
Complete JUnit 5 migration for the remaining test files:
- GlueSchemaRegistryAvroKinesisITCase: @ClassRule -> @container,
  Assume -> Assumptions, remove extends TestLogger, fix log -> LOGGER
- GlueSchemaRegistryJsonKinesisITCase: fix log -> LOGGER
- SqsSinkITTest: @ClassRule -> @container, lifecycle annotations
- KinesisFirehoseTableITTest: @rule Timeout -> @timeout, @container
- KinesisStreamsTableApiIT: @rule Timeout -> @timeout, lifecycle
- KinesisDynamicTableSourceFactoryTest: import ordering

No test logic changes. Zero JUnit 4 imports remaining.
@jlalwani-amazon jlalwani-amazon force-pushed the flink-27941-junit5-migration branch from b62fb97 to 153e4b7 Compare May 8, 2026 21:23
Copy link
Copy Markdown
Contributor

@ferenc-csaky ferenc-csaky left a comment

Choose a reason for hiding this comment

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

Mostly looks good, added 2 comments.

Comment on lines +105 to +110
Assumptions.assumeTrue(
!StringUtils.isNullOrWhitespaceOnly(ACCESS_KEY),
"Access key not configured, skipping test...");
Assumptions.assumeTrue(
!StringUtils.isNullOrWhitespaceOnly(SECRET_KEY),
"Secret key not configured, skipping test...");
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.

Let's use AssertJ's Assumptions.assumeThat. I'd prefer static import that method too, but that's maybe personal taste.

Same applies to GlueSchemaRegistryAvroKinesisITCase.


/** Test for {@link KinesisDynamicSource} created by {@link KinesisDynamicTableFactory}. */
public class KinesisDynamicTableSourceFactoryTest extends TestLogger {
public class KinesisDynamicTableSourceFactoryTest {
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.

To keep the TestLogger on JUnit5 there is a matching extension:

@ExtendWith(TestLoggerExtension.class)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants