KAFKA-20962: Remove hamcrest from org.apache.kafka.streams.kstream.internals.suppress package - #23199
Open
harmadasg wants to merge 5 commits into
Open
KAFKA-20962: Remove hamcrest from org.apache.kafka.streams.kstream.internals.suppress package#23199harmadasg wants to merge 5 commits into
harmadasg wants to merge 5 commits into
Conversation
…ternals.suppress package
chia7712
reviewed
Aug 25, 2026
| verifyMetric(metrics, bufferSizeMaxMetric, is(82.0)); | ||
| verifyMetric(metrics, bufferCountAvgMetric, is(1.0)); | ||
| verifyMetric(metrics, bufferCountMaxMetric, is(2.0)); | ||
| assertEquals(evictionRateMetric.description(), metrics.get(evictionRateMetric).metricName().description()); |
Member
There was a problem hiding this comment.
This duplicates the description check in verifyMetric.
Contributor
Author
There was a problem hiding this comment.
Thanks I missed the verifyMetric call from the above block on the very same metric, fixed it in 68c1948
chia7712
reviewed
Aug 26, 2026
| @@ -428,7 +423,7 @@ public void suppressShouldShutDownWhenOverRecordCapacity() { | |||
| harness.processor.process(new Record<>("dummyKey", value, timestamp)); | |||
| fail("expected an exception"); | |||
| } catch (final StreamsException e) { | |||
Member
There was a problem hiding this comment.
Would you mind rewriting these two tests using assertThrows?
Contributor
Author
There was a problem hiding this comment.
Sure no problem the test code looks more idiomatic based on your suggestion. Fixed it in both places
chia7712
reviewed
Aug 26, 2026
| fail("expected an exception"); | ||
| } catch (final StreamsException e) { | ||
| assertThat(e.getMessage(), containsString("buffer exceeded its max capacity")); | ||
| assertTrue(e.getMessage().contains("buffer exceeded its max capacity")); |
chia7712
reviewed
Aug 27, 2026
| try { | ||
| final Throwable exception = assertThrows(StreamsException.class, () -> { | ||
| harness.processor.process(new Record<>("dummyKey", value, timestamp)); | ||
| fail("expected an exception"); |
Member
There was a problem hiding this comment.
Please remove fail("expected an exception");
Contributor
Author
There was a problem hiding this comment.
thanks done, also included the the exception message comparison in the assertThrows part to be more compact and readable
chia7712
reviewed
Aug 27, 2026
| try { | ||
| final Throwable exception = assertThrows(StreamsException.class, () -> { | ||
| harness.processor.process(new Record<>("dummyKey", value, timestamp)); | ||
| fail("expected an exception"); |
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.
Migrate usages of hamcrest to junit
Reviewers: Chia-Ping Tsai chia7712@gmail.com