KAFKA-20992: Remove hamcrest from org.apache.kafka.test package - #23287
Open
hysuuuu wants to merge 3 commits into
Open
KAFKA-20992: Remove hamcrest from org.apache.kafka.test package#23287hysuuuu wants to merge 3 commits into
hysuuuu wants to merge 3 commits into
Conversation
m1a2st
reviewed
Aug 27, 2026
m1a2st
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch, some minor comments
|
|
||
| public void checkAndClearProcessResult(final KeyValueTimestamp<?, ?>... expected) { | ||
| assertThat("the number of outputs:" + processed, processed.size(), is(expected.length)); | ||
| assertEquals(expected.length, processed.size(), () -> "the number of outputs:" + processed); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertEquals(expected.length, processed.size(), () -> "the number of outputs:" + processed); | |
| assertEquals(expected.length, processed.size(), "the number of outputs:" + processed); |
|
|
||
| public void checkEmptyAndClearProcessResult() { | ||
| assertThat("the number of outputs:", processed.size(), is(0)); | ||
| assertEquals(0, processed.size(), "the number of outputs:"); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertEquals(0, processed.size(), "the number of outputs:"); | |
| assertEquals(0, processed.size(), "the number of outputs:" + processed); |
| public void checkAndClearPunctuateResult(final PunctuationType type, final long... expected) { | ||
| final ArrayList<Long> punctuated = type == PunctuationType.STREAM_TIME ? punctuatedStreamTime : punctuatedSystemTime; | ||
| assertThat("the number of outputs:", punctuated.size(), is(expected.length)); | ||
| assertEquals(expected.length, punctuated.size(), "the number of outputs:"); |
|
|
||
| public void checkAndClearProcessedRecords(final Record<?, ?>... expected) { | ||
| assertThat("the number of outputs:" + processed, processed.size(), is(expected.length)); | ||
| assertEquals(expected.length, processed.size(), () -> "the number of outputs:" + processed); |
Contributor
There was a problem hiding this comment.
Suggested change
| assertEquals(expected.length, processed.size(), () -> "the number of outputs:" + processed); | |
| assertEquals(expected.length, processed.size(), "the number of outputs:" + processed); |
Contributor
Author
|
@m1a2st Updated. PTAL, thanks! |
chia7712
reviewed
Aug 27, 2026
| @@ -93,23 +92,23 @@ public void process(final FixedKeyRecord<KIn, VIn> record) { | |||
| } | |||
|
|
|||
| public void checkAndClearProcessResult(final KeyValueTimestamp<?, ?>... expected) { | |||
Member
There was a problem hiding this comment.
I checked the usages and neither method is called anywhere, so we could just remove them, right?
Contributor
Author
There was a problem hiding this comment.
Yes you're right, those methods are not used. I've removed them. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces Hamcrest with JUnit 5 in
MockApiFixedKeyProcessor.Testing
./gradlew streams:test --tests StreamsBuilderTest --tests KStreamImplTestReviewers: Ken Huang s7133700@gmail.com, Chia-Ping Tsai chia7712@gmail.com