kamalcph commented on code in PR #16173:
URL: https://github.com/apache/kafka/pull/16173#discussion_r1624595821


##########
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteLogManagerConfigTest.java:
##########
@@ -105,4 +116,79 @@ private Map<String, Object> 
extractProps(RemoteLogManagerConfig remoteLogManager
                   remoteLogManagerConfig.remoteLogMetadataManagerPrefix());
         return props;
     }
+
+    @Test
+    public void testHashCode_ForAllAndTwoFields() {
+        String rsmPrefix = "__custom.rsm.";
+        String rlmmPrefix = "__custom.rlmm.";
+        Map<String, Object> rsmProps = Collections.singletonMap("rsm.prop", 
"val");
+        Map<String, Object> rlmmProps = Collections.singletonMap("rlmm.prop", 
"val");
+        RemoteLogManagerConfig config1 = getRemoteLogManagerConfig(false, 
rsmPrefix, rlmmPrefix, rsmProps, rlmmProps);
+        RemoteLogManagerConfig config2 = getRemoteLogManagerConfig(false, 
rsmPrefix, rlmmPrefix, rsmProps, rlmmProps);
+
+        // Initially, hash codes should be equal for default objects
+        assertEquals(config1.hashCode(), config2.hashCode());
+
+        // Test for specific field remoteLogManagerCopierThreadPoolSize
+        RemoteLogManagerConfig config3 = new RemoteLogManagerConfig(true, 
"dummy.remote.storage.class",
+                "dummy.remote.storage.class.path",
+                "dummy.remote.log.metadata.class", 
"dummy.remote.log.metadata.class.path",
+                "listener.name", 1024 * 1024L,
+                1,
+                2, // Change here
+                2, // Change here
+                60000L, 100L, 60000L,
+                0.3, 10, 100, 100,
+                rsmPrefix, rsmProps, rlmmPrefix, rlmmProps, Long.MAX_VALUE, 
11, 1,
+                Long.MAX_VALUE, 11, 1);
+
+
+        assertNotEquals(config1.hashCode(), config3.hashCode());
+    }
+
+    @Test
+    public void testEquals_ForAllAndTwoFields() {

Review Comment:
   Can we remove this test? and add the assertion in the previous test itself?
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to