You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ce...@apache.org on 2023/02/17 15:31:40 UTC

[kafka] branch trunk updated: MINOR: Fix PluginInfoTest for Connect (#13266)

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 38e43116222 MINOR: Fix PluginInfoTest for Connect (#13266)
38e43116222 is described below

commit 38e43116222a28b4e44c75c9d41855e437801efa
Author: Chris Egerton <ch...@aiven.io>
AuthorDate: Fri Feb 17 10:31:32 2023 -0500

    MINOR: Fix PluginInfoTest for Connect (#13266)
    
    Reviewers: Kamal Chandraprakash <kc...@uber.com>
    
    Note: Merged without committer review in order to fix the build on trunk
---
 .../connect/runtime/rest/entities/PluginInfoTest.java      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/entities/PluginInfoTest.java b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/entities/PluginInfoTest.java
index e4f265ed4d7..d320c79711a 100644
--- a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/entities/PluginInfoTest.java
+++ b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/entities/PluginInfoTest.java
@@ -19,17 +19,19 @@ package org.apache.kafka.connect.runtime.rest.entities;
 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"));
+        assertFalse(filter.equals(new Object()));
+        assertFalse(filter.equals(null));
+        assertTrue(filter.equals(DelegatingClassLoader.UNDEFINED_VERSION));
     }
 }