You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2018/12/03 05:55:33 UTC

[kafka] branch 1.1 updated: MINOR: improve QueryableStateIntegrationTest (#5988)

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

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


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

commit 042929ca79f05bc7848f00fcea490adcf8ffc894
Author: Matthias J. Sax <mj...@apache.org>
AuthorDate: Sun Dec 2 21:55:25 2018 -0800

    MINOR: improve QueryableStateIntegrationTest (#5988)
    
    Fix test Comparators.
    
    Reviewers: Guozhang Wang <wa...@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 fc2eacc..e71ad45 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
@@ -156,7 +156,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>>() {
@@ -164,7 +165,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(