Shoothzj commented on a change in pull request #13678:
URL: https://github.com/apache/pulsar/pull/13678#discussion_r781738658



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java
##########
@@ -496,6 +497,53 @@ public void testRemoveOwnershipAndSplitBundle() throws 
Exception {
         }
     }
 
+
+    @Test
+    public void testSplitBundleAndRemoveOldBundleFromOwnerShipCache() throws 
Exception {
+        OwnershipCache ownershipCache = 
spy(pulsar.getNamespaceService().getOwnershipCache());
+        
doReturn(CompletableFuture.completedFuture(null)).when(ownershipCache).disableOwnership(any(NamespaceBundle.class));
+
+        Field ownership = 
NamespaceService.class.getDeclaredField("ownershipCache");
+        ownership.setAccessible(true);
+        ownership.set(pulsar.getNamespaceService(), ownershipCache);
+
+        NamespaceService namespaceService = pulsar.getNamespaceService();
+        NamespaceName nsname = NamespaceName.get("pulsar/global/ns1");
+        TopicName topicName = 
TopicName.get("persistent://pulsar/global/ns1/topic-1");
+        NamespaceBundles bundles = 
namespaceService.getNamespaceBundleFactory().getBundles(nsname);
+
+

Review comment:
       Suggest one space line instead of two




-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to