diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java index 10f3d4922273f..1c16e0401e081 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java @@ -908,11 +908,14 @@ public void testUpdatePartitionedTopicProperties() throws Exception { final String topicNameTwo = "persistent://" + namespace + "/testUpdatePartitionedTopicProperties2"; admin.namespaces().createNamespace(namespace, 20); - // create partitioned topic with properties + // create partitioned topic without properties + admin.topics().createPartitionedTopic(topicName, 2); + Map properties = admin.topics().getProperties(topicName); + Assert.assertNull(properties); Map topicProperties = new HashMap<>(); topicProperties.put("key1", "value1"); - admin.topics().createPartitionedTopic(topicName, 2, topicProperties); - Map properties = admin.topics().getProperties(topicName); + admin.topics().updateProperties(topicName, topicProperties); + properties = admin.topics().getProperties(topicName); Assert.assertNotNull(properties); Assert.assertEquals(properties.get("key1"), "value1");