You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "divijvaidya (via GitHub)" <gi...@apache.org> on 2023/02/10 09:53:30 UTC

[GitHub] [kafka] divijvaidya commented on a diff in pull request #13219: MINOR: Simplify JUnit assertions; remove accidental unnecessary code

divijvaidya commented on code in PR #13219:
URL: https://github.com/apache/kafka/pull/13219#discussion_r1102521315


##########
clients/src/test/java/org/apache/kafka/common/utils/ImplicitLinkedHashCollectionTest.java:
##########
@@ -142,8 +143,8 @@ static void expectTraversal(Iterator<TestElement> iterator, Integer... sequence)
             assertEquals(sequence[i].intValue(), element.key, "Iterator value number " + (i + 1) + " was incorrect.");
             i = i + 1;
         }
-        assertTrue(i == sequence.length, "Iterator yieled " + (i + 1) + " elements, but " +
-            sequence.length + " were expected.");
+        assertEquals(i, sequence.length, "Iterator yieled " + (i + 1) + " elements, but " +

Review Comment:
   in assertEquals, the first parameter is the one that is expected, hence, in this case it would be `assertEquals(sequence.length, i, ....)`
   
   (same comments for other places)



-- 
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