You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "shantanushukla (via GitHub)" <gi...@apache.org> on 2026/08/26 04:38:55 UTC
[PR] KAFKA-20988: Remove hamcrest from streams test fixtures [kafka]
shantanushukla opened a new pull request, #23279:
URL: https://github.com/apache/kafka/pull/23279
JIRA: https://issues.apache.org/jira/browse/KAFKA-20988
Parent: https://issues.apache.org/jira/browse/KAFKA-20948
Migrate hamcrest `assertThat` usage in streams test fixtures and `org.apache.kafka.test` mock helpers to JUnit 5.
Files changed:
- `streams/src/testFixtures/java/org/apache/kafka/streams/utils/TestUtils.java`
- `streams/src/testFixtures/java/org/apache/kafka/streams/utils/UniqueTopicSerdeScope.java`
- `streams/src/testFixtures/java/org/apache/kafka/test/MockApiProcessor.java`
- `streams/src/testFixtures/java/org/apache/kafka/test/MockClientSupplier.java`
- `streams/src/testFixtures/java/org/apache/kafka/test/StreamsTestUtils.java`
- `streams/src/test/java/org/apache/kafka/test/MockApiFixedKeyProcessor.java`
`AssignmentTestUtils` is out of scope: it still exposes custom Hamcrest `Matcher`s used by unclaimed `processor.internals.assignment` tests, so `testFixturesImplementation libs.hamcrest` on `:streams` is retained.
No production code changes. This contribution is original work and is licensed to the project under the Apache License, Version 2.0.
### Tests
```
./gradlew :streams:compileTestFixturesJava :streams:compileTestJava \
:streams:checkstyleTest :streams:spotlessCheck \
:streams:test --tests org.apache.kafka.streams.kstream.internals.KStreamMapTest
```
BUILD SUCCESSFUL.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20988: Remove hamcrest from streams test fixtures [kafka]
Posted by "m1a2st (via GitHub)" <gi...@apache.org>.
m1a2st merged PR #23279:
URL: https://github.com/apache/kafka/pull/23279
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20988: Remove hamcrest from streams test fixtures [kafka]
Posted by "shantanushukla (via GitHub)" <gi...@apache.org>.
shantanushukla commented on PR #23279:
URL: https://github.com/apache/kafka/pull/23279#issuecomment-5439610695
@m1a2st Thanks for the review. Converted `AssignmentTestUtils` to JUnit 5 as well: the remaining `assertThat` calls are gone, and the custom Hamcrest matchers (`hasActiveTasks` / `hasAssignedTasks` / `hasStandbyTasks` / `hasProperty`) are replaced with direct assertions in `ClientStateTest`, `TaskMovementTest`, and `HighAvailabilityTaskAssignorTest`.
`testFixturesImplementation libs.hamcrest` is now removed from `:streams` since no test fixture uses Hamcrest anymore. `:streams` test code still keeps `testImplementation libs.hamcrest` for the rest of the assignment tests.
```
./gradlew :streams:test \
--tests org.apache.kafka.streams.processor.internals.assignment.ClientStateTest \
--tests org.apache.kafka.streams.processor.internals.assignment.TaskMovementTest \
--tests org.apache.kafka.streams.processor.internals.assignment.HighAvailabilityTaskAssignorTest \
:streams:checkstyleTest :streams:spotlessCheck
```
BUILD SUCCESSFUL.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20988: Remove hamcrest from streams test fixtures [kafka]
Posted by "shantanushukla (via GitHub)" <gi...@apache.org>.
shantanushukla commented on PR #23279:
URL: https://github.com/apache/kafka/pull/23279#issuecomment-5439688483
Follow-up: the three callers now use JUnit helpers on `AssignmentTestUtils` (`assertHasActiveTasks` / `assertHasAssignedTasks` / `assertHasStandbyTasks` / `assertHasProperty`) rather than inlined `assertEquals`. Same behavior, helpers stay in one place.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org