You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sjhajharia (via GitHub)" <gi...@apache.org> on 2025/09/24 17:55:58 UTC

[PR] KAFKA-19733: Fix arguments to assertEquals() in clients module [kafka]

sjhajharia opened a new pull request, #20586:
URL: https://github.com/apache/kafka/pull/20586

   The given PR mostly fixes the order of arguments in `assertEquals()` for the Clients module. Some minor cleanups were included with the same too.
   
   https://issues.apache.org/jira/browse/KAFKA-19733


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-19733: Fix arguments to assertEquals() in clients module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #20586:
URL: https://github.com/apache/kafka/pull/20586#discussion_r2378205179


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignorTest.java:
##########
@@ -862,7 +862,7 @@ public void testSubscriptionNotEqualAndAssignSamePartitionWith3Generation() {
             assertEquals(assign.values().stream().mapToInt(List::size).sum(),
                     assign.values().stream().flatMap(List::stream).collect(Collectors.toSet()).size());
             for (List<TopicPartition> list: assign.values()) {
-                assertTrue(list.size() >= 1 && list.size() <= 2);
+                assertTrue(!list.isEmpty() && list.size() <= 2);

Review Comment:
   It seems to me the origin version is more readable 😄 



##########
clients/src/test/java/org/apache/kafka/common/acl/AclBindingTest.java:
##########
@@ -66,7 +66,7 @@ public void testMatching() {
             new ResourcePattern(ResourceType.TOPIC, "mytopic", PatternType.LITERAL),
             new AccessControlEntry("User:ANONYMOUS", "", AclOperation.ALL, AclPermissionType.ALLOW));
         assertEquals(ACL1, acl1Copy);
-        assertEquals(acl1Copy, ACL1);
+        assertEquals(ACL1, acl1Copy);

Review Comment:
   I believe that is expected order. see line#68



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-19733: Fix arguments to assertEquals() in clients module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on code in PR #20586:
URL: https://github.com/apache/kafka/pull/20586#discussion_r2378231713


##########
clients/src/test/java/org/apache/kafka/common/acl/AclBindingTest.java:
##########
@@ -66,7 +66,7 @@ public void testMatching() {
             new ResourcePattern(ResourceType.TOPIC, "mytopic", PatternType.LITERAL),
             new AccessControlEntry("User:ANONYMOUS", "", AclOperation.ALL, AclPermissionType.ALLOW));
         assertEquals(ACL1, acl1Copy);
-        assertEquals(acl1Copy, ACL1);
+        assertEquals(ACL1, acl1Copy);

Review Comment:
   Makes sense. Updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-19733: Fix arguments to assertEquals() in clients module [kafka]

Posted by "sjhajharia (via GitHub)" <gi...@apache.org>.
sjhajharia commented on code in PR #20586:
URL: https://github.com/apache/kafka/pull/20586#discussion_r2378231199


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignorTest.java:
##########
@@ -862,7 +862,7 @@ public void testSubscriptionNotEqualAndAssignSamePartitionWith3Generation() {
             assertEquals(assign.values().stream().mapToInt(List::size).sum(),
                     assign.values().stream().flatMap(List::stream).collect(Collectors.toSet()).size());
             for (List<TopicPartition> list: assign.values()) {
-                assertTrue(list.size() >= 1 && list.size() <= 2);
+                assertTrue(!list.isEmpty() && list.size() <= 2);

Review Comment:
   Sure. Updated the same.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-19733: Fix arguments to assertEquals() in clients module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #20586:
URL: https://github.com/apache/kafka/pull/20586


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org