Skip to content

KAFKA-20963: Remove hamcrest from org.apache.kafka.streams.processor - #23200

Merged
m1a2st merged 1 commit into
apache:trunkfrom
harmadasg:KAFKA-20963
Aug 27, 2026
Merged

KAFKA-20963: Remove hamcrest from org.apache.kafka.streams.processor#23200
m1a2st merged 1 commit into
apache:trunkfrom
harmadasg:KAFKA-20963

Conversation

@harmadasg

@harmadasg harmadasg commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Migrate usages of hamcrest to junit

Reviewers: Uros (github:uros-b), Ken Huang s7133700@gmail.com

@github-actions github-actions Bot added triage PRs from the community streams tests Test fixes (including flaky tests) small Small PRs labels Aug 19, 2026
@github-actions github-actions Bot removed the triage PRs from the community label Aug 22, 2026
chia7712 pushed a commit that referenced this pull request Aug 26, 2026
…nternals.metrics package (#23278)

JIRA: https://issues.apache.org/jira/browse/KAFKA-20987
Parent: https://issues.apache.org/jira/browse/KAFKA-20948

Migrate hamcrest `assertThat` usage in
`org.apache.kafka.streams.processor.internals.metrics` tests to JUnit 5.
This package is not covered by the existing subtasks:
- KAFKA-20963 / PR #23200 covers only
`org.apache.kafka.streams.processor` (top-level)
- KAFKA-20965 / PR #23201 covers
`org.apache.kafka.streams.state.internals.metrics`

Files changed:
- `ProcessorNodeMetricsTest.java`
- `StreamsMetricsImplTest.java`
- `TaskMetricsTest.java`
- `ThreadMetricsTest.java`
- `TopicMetricsTest.java`

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:test \
  --tests org.apache.kafka.streams.processor.internals.metrics.ProcessorNodeMetricsTest \
  --tests org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImplTest \
  --tests org.apache.kafka.streams.processor.internals.metrics.TaskMetricsTest \
  --tests org.apache.kafka.streams.processor.internals.metrics.ThreadMetricsTest \
  --tests org.apache.kafka.streams.processor.internals.metrics.TopicMetricsTest \
  :streams:checkstyleTest :streams:spotlessCheck
```
BUILD SUCCESSFUL.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

@m1a2st m1a2st 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.

LGTM

@m1a2st
m1a2st merged commit 21ff2e4 into apache:trunk Aug 27, 2026
21 checks passed
@@ -35,29 +32,8 @@ public void extractSystemTimestamp() {
final long timestamp = extractor.extract(new ConsumerRecord<>("anyTopic", 0, 0, null, null), 42);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should set an explicit record timestamp to verify that WallclockTimestampExtractor ignores both the record timestamp and the partition time, and returns the wall-clock time instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is unrelated to this patch. I will file a patch to address it

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.

Thanks for pointing out!

I opened a minor patch for it: #23289.

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

Labels

ci-approved small Small PRs streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants