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

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


The following commit(s) were added to refs/heads/2.7 by this push:
     new a20f210  KAFKA-12323 Follow-up: Refactor the unit test a bit (#10205)
a20f210 is described below

commit a20f210fa5b24d7e24e6dfe77ce87738455bd288
Author: Guozhang Wang <[email protected]>
AuthorDate: Mon Mar 1 12:11:11 2021 -0800

    KAFKA-12323 Follow-up: Refactor the unit test a bit (#10205)
    
    Reviewers: Matthias J. Sax <[email protected]>
---
 .../processor/internals/StreamThreadTest.java      | 42 +++++++++++-----------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git 
a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamThreadTest.java
 
b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamThreadTest.java
index 50c42f9..96ef115 100644
--- 
a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamThreadTest.java
+++ 
b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamThreadTest.java
@@ -1759,19 +1759,17 @@ public class StreamThreadTest {
         assertEquals(0, punctuatedWallClockTime.size());
 
         mockTime.sleep(100L);
-        for (long i = 0L; i < 10L; i++) {
-            clientSupplier.consumer.addRecord(new ConsumerRecord<>(
-                topic1,
-                1,
-                i,
-                i * 100L,
-                TimestampType.CREATE_TIME,
-                ConsumerRecord.NULL_CHECKSUM,
-                ("K" + i).getBytes().length,
-                ("V" + i).getBytes().length,
-                ("K" + i).getBytes(),
-                ("V" + i).getBytes()));
-        }
+        clientSupplier.consumer.addRecord(new ConsumerRecord<>(
+            topic1,
+            1,
+            100L,
+            100L,
+            TimestampType.CREATE_TIME,
+            ConsumerRecord.NULL_CHECKSUM,
+            "K".getBytes().length,
+            "V".getBytes().length,
+            "K".getBytes(),
+            "V".getBytes()));
 
         thread.runOnce();
 
@@ -1851,19 +1849,19 @@ public class StreamThreadTest {
         clientSupplier.consumer.addRecord(new ConsumerRecord<>(
             topic1,
             1,
-            0L,
-             100L,
-             TimestampType.CREATE_TIME,
-             ConsumerRecord.NULL_CHECKSUM,
-             "K".getBytes().length,
-             "V".getBytes().length,
-             "K".getBytes(),
-             "V".getBytes()));
+            110L,
+            110L,
+            TimestampType.CREATE_TIME,
+            ConsumerRecord.NULL_CHECKSUM,
+            "K".getBytes().length,
+            "V".getBytes().length,
+            "K".getBytes(),
+            "V".getBytes()));
 
         thread.runOnce();
 
         assertEquals(2, peekedContextTime.size());
-        assertEquals(0L, peekedContextTime.get(1).longValue());
+        assertEquals(110L, peekedContextTime.get(1).longValue());
     }
 
     @Test

Reply via email to