C0urante commented on code in PR #13266:
URL: https://github.com/apache/kafka/pull/13266#discussion_r1109946722


##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/entities/PluginInfoTest.java:
##########
@@ -19,17 +19,19 @@
 import org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader;
 import org.junit.Test;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class PluginInfoTest {
 
     @Test
     public void testNoVersionFilter() {
         PluginInfo.NoVersionFilter filter = new PluginInfo.NoVersionFilter();
-        assertNotEquals("1.0", filter);
-        assertNotEquals(filter, new Object());
-        assertNotEquals(null, filter);
-        assertEquals(DelegatingClassLoader.UNDEFINED_VERSION, filter);
+        // We intentionally refrain from using assertEquals and assertNotEquals
+        // here to ensure that the filter's equals() method is used
+        assertFalse(filter.equals("1.0"));

Review Comment:
   We intentionally refrain from this as it does not guarantee that the 
filter's equals method is used. The filter's equals method is what we need to 
test here since it is used by Jackson to prevent some fields from being 
deserialized in REST entities depending on their values.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to