diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImplTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImplTest.java index 990a1e8ff15ea..dd4335b124eca 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImplTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImplTest.java @@ -435,7 +435,7 @@ public void testFilterBundlesWhileWritingToMetadataStore() throws Exception { pulsarServices.put(pulsar1.getWebServiceAddress(), pulsar1); pulsarServices.put(pulsar2.getWebServiceAddress(), pulsar2); MetadataCache metadataCache = pulsar1.getLocalMetadataStore().getMetadataCache(BundleData.class); - PulsarService leaderBroker = pulsarServices.get(pulsar1.getLeaderElectionService().getCurrentLeader().get().getServiceUrl()); + PulsarService leaderBroker = pulsarServices.get("http://" + pulsar1.getLeaderElectionService().getCurrentLeader().get().getBrokerId()); ModularLoadManagerImpl loadManager = (ModularLoadManagerImpl) getField( leaderBroker.getLoadManager().get(), "loadManager"); int topK = 1;