You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jy...@apache.org on 2026/08/28 01:32:13 UTC

(kafka) branch trunk updated: KAFKA-20991 Remove hamcrest from org.apache.kafka.streams.tests package (#23282)

This is an automated email from the ASF dual-hosted git repository.

m1a2st pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2ef53f8fe4a KAFKA-20991 Remove hamcrest from org.apache.kafka.streams.tests package (#23282)
2ef53f8fe4a is described below

commit 2ef53f8fe4af845b9caa606b816cd67ae10b5306
Author: KC.H <34...@users.noreply.github.com>
AuthorDate: Fri Aug 28 09:32:06 2026 +0800

    KAFKA-20991 Remove hamcrest from org.apache.kafka.streams.tests package (#23282)
    
    Migrate the Hamcrest assertions in the `org.apache.kafka.streams.tests`
    package to JUnit 5 assertions.
    
    Testing:
    ```
    ./gradlew :streams:test --tests org.apache.kafka.streams.tests.RelationalSmokeTestTest
    ```
    
    Reviewers: Ken Huang <s7...@gmail.com>
---
 .../apache/kafka/streams/tests/RelationalSmokeTestTest.java | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTestTest.java b/streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTestTest.java
index 2328b6eb9e8..94a66434c25 100644
--- a/streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTestTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTestTest.java
@@ -31,8 +31,8 @@ import org.junit.jupiter.api.Timeout;
 import java.util.Map;
 import java.util.TreeMap;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @Timeout(600)
 public class RelationalSmokeTestTest extends SmokeTestUtil {
@@ -95,16 +95,15 @@ public class RelationalSmokeTestTest extends SmokeTestUtil {
             final Map<Integer, RelationalSmokeTest.AugmentedComment> augmentedCommentResults =
                 augmentedComments.readKeyValuesToMap();
 
-            assertThat(augmentedArticleResults.size(), is(dataSet.getArticles().length));
-            assertThat(augmentedCommentResults.size(), is(dataSet.getComments().length));
+            assertEquals(dataSet.getArticles().length, augmentedArticleResults.size());
+            assertEquals(dataSet.getComments().length, augmentedCommentResults.size());
 
-            assertThat(
+            assertTrue(
                 RelationalSmokeTest.App.verifySync(true,
                                                    articleMap,
                                                    commentMap,
                                                    augmentedArticleResults,
-                                                   augmentedCommentResults),
-                is(true));
+                                                   augmentedCommentResults));
         }
     }
 }
\ No newline at end of file