nodece commented on code in PR #16562:
URL: https://github.com/apache/pulsar/pull/16562#discussion_r919864601


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java:
##########
@@ -1828,10 +1830,18 @@ public void testSplitBundleForMultiTimes() throws 
Exception{
         String namespace = BrokerTestUtil.newUniqueName(this.testTenant + 
"/namespace");
         BundlesData data = BundlesData.builder().numBundles(4).build();
         admin.namespaces().createNamespace(namespace, data);
+        LookupOptions optionsHttps = 
LookupOptions.builder().authoritative(false).requestHttps(true).readOnly(false).build();
+        URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         for (int i = 0; i < 10; i ++) {
             final BundlesData bundles = 
admin.namespaces().getBundles(namespace);
             final String bundle = bundles.getBoundaries().get(0) + "_" + 
bundles.getBoundaries().get(1);
+            NamespaceBundle testBundle = new 
NamespaceBundle(NamespaceName.get(namespace),
+                    Range.range(Long.decode(bundles.getBoundaries().get(0)), 
BoundType.CLOSED,
+                            Long.decode(bundles.getBoundaries().get(1)), 
BoundType.OPEN),
+                    pulsar.getNamespaceService().getNamespaceBundleFactory());
+            
doReturn(Optional.of(localWebServiceUrl)).when(nsSvc).getWebServiceUrl(testBundle,
 optionsHttps);

Review Comment:
   You also using `mockWebUrl()`.



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java:
##########
@@ -1828,10 +1830,18 @@ public void testSplitBundleForMultiTimes() throws 
Exception{
         String namespace = BrokerTestUtil.newUniqueName(this.testTenant + 
"/namespace");
         BundlesData data = BundlesData.builder().numBundles(4).build();
         admin.namespaces().createNamespace(namespace, data);
+        LookupOptions optionsHttps = 
LookupOptions.builder().authoritative(false).requestHttps(true).readOnly(false).build();
+        URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         for (int i = 0; i < 10; i ++) {
             final BundlesData bundles = 
admin.namespaces().getBundles(namespace);
             final String bundle = bundles.getBoundaries().get(0) + "_" + 
bundles.getBoundaries().get(1);
+            NamespaceBundle testBundle = new 
NamespaceBundle(NamespaceName.get(namespace),
+                    Range.range(Long.decode(bundles.getBoundaries().get(0)), 
BoundType.CLOSED,
+                            Long.decode(bundles.getBoundaries().get(1)), 
BoundType.OPEN),
+                    pulsar.getNamespaceService().getNamespaceBundleFactory());
+            
doReturn(Optional.of(localWebServiceUrl)).when(nsSvc).getWebServiceUrl(testBundle,
 optionsHttps);

Review Comment:
   You can also using `mockWebUrl()`.



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