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

technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 03e0787cc44 [improve][test]Add new test 
PartitionCreationTest.testGetPoliciesIfPartitionsNotCreated (#24681)
03e0787cc44 is described below

commit 03e0787cc445ecab5207769e0859c64fb589a0f3
Author: fengyubiao <yubiao.f...@streamnative.io>
AuthorDate: Fri Aug 29 09:39:31 2025 +0800

    [improve][test]Add new test 
PartitionCreationTest.testGetPoliciesIfPartitionsNotCreated (#24681)
---
 .../apache/pulsar/client/api/PartitionCreationTest.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionCreationTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionCreationTest.java
index ddb3e91a730..8a88a4169b5 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionCreationTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionCreationTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.pulsar.client.api;
 
+import org.apache.pulsar.broker.BrokerTestUtil;
 import org.apache.pulsar.client.admin.PulsarAdminException;
 import org.apache.pulsar.client.impl.MultiTopicsConsumerImpl;
 import org.apache.pulsar.common.naming.TopicDomain;
@@ -120,6 +121,20 @@ public class PartitionCreationTest extends 
ProducerConsumerBase {
         Assert.assertEquals(consumer.getConsumers().size(), 5);
     }
 
+    @Test
+    public void testGetPoliciesIfPartitionsNotCreated() throws Exception {
+        final String topic = 
BrokerTestUtil.newUniqueName("persistent://public/default/tp");
+        int numPartitions = 3;
+        // simulate partitioned topic without partitions
+        
pulsar.getPulsarResources().getNamespaceResources().getPartitionedTopicResources()
+                .createPartitionedTopicAsync(TopicName.get(topic),
+                        new PartitionedTopicMetadata(numPartitions)).join();
+        // Verify: the command will not get an topic not found error.
+        admin.topics().getReplicationClusters(topic, true);
+        // cleanup.
+        admin.topics().deletePartitionedTopic(topic);
+    }
+
     @DataProvider(name = "restCreateMissedPartitions")
     public Object[] restCreateMissedPartitions() {
         return new Object[] { true, false };

Reply via email to