lhotari commented on code in PR #19337:
URL: https://github.com/apache/pulsar/pull/19337#discussion_r1091003085


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnerShipForCurrentServerTestBase.java:
##########
@@ -118,96 +86,22 @@ protected void startBroker() throws Exception {
             conf.setWebServicePortTls(Optional.of(0));
             serviceConfigurationList.add(conf);
 
-            PulsarService pulsar = 
spyWithClassAndConstructorArgs(PulsarService.class, conf);
-
-            setupBrokerMocks(pulsar);
-            pulsar.start();
+            PulsarTestContext.Builder testContextBuilder =
+                    PulsarTestContext.startableBuilder()
+                            .config(conf);
+            if (i > 0) {
+                
testContextBuilder.reuseMockBookkeeperAndMetadataStores(pulsarTestContexts.get(0));

Review Comment:
   PulsarTestContext holds the mock bookkeeper and metadata store 
(mockzookeeper) references. The "reuseMockBookkeeperAndMetadataStores" can be 
used to share the mock bookkeeper and zookeeper from another context. 



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