kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject [kafka] branch 0.10.2 updated: MINOR: improve QueryableStateIntegrationTest (#5988)
Date Mon, 03 Dec 2018 06:01:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/0.10.2 by this push:
     new 1d5ff11  MINOR: improve QueryableStateIntegrationTest (#5988)
1d5ff11 is described below

commit 1d5ff118d00763aa06f5498ae8b49f8fb5dfe12a
Author: Matthias J. Sax <mjsax@apache.org>
AuthorDate: Sun Dec 2 21:55:25 2018 -0800

    MINOR: improve QueryableStateIntegrationTest (#5988)
    
    Fix test Comparators.
    
    Reviewers: Guozhang Wang <wangguoz@gmail.com>
---
 .../kafka/streams/integration/QueryableStateIntegrationTest.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
b/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
index d09d505..64c70de 100644
--- a/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
+++ b/streams/src/test/java/org/apache/kafka/streams/integration/QueryableStateIntegrationTest.java
@@ -150,7 +150,8 @@ public class QueryableStateIntegrationTest {
             @Override
             public int compare(final KeyValue<String, String> o1,
                                final KeyValue<String, String> o2) {
-                return o1.key.compareTo(o2.key);
+                final int keyComparison = o1.key.compareTo(o2.key);
+                return keyComparison != 0 ? keyComparison : o1.value.compareTo(o2.value);
             }
         };
         stringLongComparator = new Comparator<KeyValue<String, Long>>() {
@@ -158,7 +159,8 @@ public class QueryableStateIntegrationTest {
             @Override
             public int compare(final KeyValue<String, Long> o1,
                                final KeyValue<String, Long> o2) {
-                return o1.key.compareTo(o2.key);
+                final int keyComparison =  o1.key.compareTo(o2.key);
+                return keyComparison != 0 ? keyComparison : o1.value.compareTo(o2.value);
             }
         };
         inputValues = Arrays.asList(


Mime
View raw message