ChimdumebiNebolisa commented on code in PR #25163:
URL: https://github.com/apache/pulsar/pull/25163#discussion_r3565314596


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java:
##########
@@ -2458,6 +2458,32 @@ public void 
testAutoTopicCreationOverrideWithMaxNumPartitionsLimit() throws Exce
             assertTrue(ex.getCause() instanceof NotAcceptableException);
         }
     }
+
+    @Test
+    public void 
testAutoTopicCreationOverrideNonPartitionedDefaultNumPartitionsIgnored() throws 
Exception {
+        String tenantName = newUniqueName("prop-xyz2");
+        String namespaceName = tenantName + "/ns-" + 
System.currentTimeMillis();
+        TenantInfoImpl tenantInfo = new TenantInfoImpl(Set.of("role1", 
"role2"), Set.of("test"));
+        admin.tenants().createTenant(tenantName, tenantInfo);
+        admin.namespaces().createNamespace(namespaceName, Set.of("test"));
+
+        AutoTopicCreationOverride overridePolicy = 
AutoTopicCreationOverride.builder()
+                .allowAutoTopicCreation(true)
+                .topicType(TopicType.NON_PARTITIONED.toString())
+                .defaultNumPartitions(5)
+                .build();
+        admin.namespaces().setAutoTopicCreation(namespaceName, overridePolicy);

Review Comment:
   Updated this to address the review comment. The acceptance test now uses 
`1`, and I added a separate test confirming that `5` is rejected with HTTP 412. 
The targeted tests and `quickCheck` pass locally. CI is currently awaiting 
maintainer approval.



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