chia7712 commented on code in PR #15635:
URL: https://github.com/apache/kafka/pull/15635#discussion_r1545767933


##########
core/src/test/scala/unit/kafka/zk/migration/ZkConfigMigrationClientTest.scala:
##########
@@ -112,10 +113,25 @@ class ZkConfigMigrationClientTest extends 
ZkMigrationTestHarness {
         assertEquals(newProps.get(key), value)
       }
     }
+    assertPathExistenceAndData("/config/changes/config_change_0000000000", 
"""{"version":2,"entity_path":"brokers/1"}""")
 
     migrationState = migrationClient.configClient().deleteConfigs(
       new ConfigResource(ConfigResource.Type.BROKER, "1"), migrationState)
     assertEquals(0, zkClient.getEntityConfigs(ConfigType.BROKER, "1").size())
+    assertPathExistenceAndData("/config/changes/config_change_0000000001", 
"""{"version":2,"entity_path":"brokers/1"}""")
+
+    // make sure there is no more config change notification in znode
+    
assertFalse(zkClient.pathExists("/config/changes/config_change_0000000002"))
+  }
+
+  private def assertPathExistenceAndData(expectedPath: String, data: String): 
Unit = {
+    assertTrue(zkClient.pathExists(expectedPath))
+    assertEquals(Some(data), dataAsString(expectedPath))

Review Comment:
   how about `assertEquals(Some(data), 
zkClient.getDataAndStat(expectedPath)._1.map(new String(_, UTF_8)))`?



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