@@ -119,9 +119,10 @@ func TestLookupSuccess(t *testing.T) {
119119
120120 expectedRequests : []pb.CommandLookupTopic {
121121 {
122- RequestId : proto .Uint64 (1 ),
123- Topic : proto .String ("my-topic" ),
124- Authoritative : proto .Bool (false ),
122+ RequestId : proto .Uint64 (1 ),
123+ Topic : proto .String ("my-topic" ),
124+ Authoritative : proto .Bool (false ),
125+ AdvertisedListenerName : proto .String ("" ),
125126 },
126127 },
127128 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -132,7 +133,7 @@ func TestLookupSuccess(t *testing.T) {
132133 BrokerServiceUrl : proto .String ("pulsar://broker-1:6650" ),
133134 },
134135 },
135- }, url , serviceNameResolver , false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
136+ }, url , serviceNameResolver , false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
136137
137138 lr , err := ls .Lookup ("my-topic" )
138139 assert .NoError (t , err )
@@ -152,9 +153,10 @@ func TestTlsLookupSuccess(t *testing.T) {
152153
153154 expectedRequests : []pb.CommandLookupTopic {
154155 {
155- RequestId : proto .Uint64 (1 ),
156- Topic : proto .String ("my-topic" ),
157- Authoritative : proto .Bool (false ),
156+ RequestId : proto .Uint64 (1 ),
157+ Topic : proto .String ("my-topic" ),
158+ Authoritative : proto .Bool (false ),
159+ AdvertisedListenerName : proto .String ("" ),
158160 },
159161 },
160162 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -165,7 +167,7 @@ func TestTlsLookupSuccess(t *testing.T) {
165167 BrokerServiceUrlTls : proto .String ("pulsar+ssl://broker-1:6651" ),
166168 },
167169 },
168- }, url , serviceNameResolver , true , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
170+ }, url , serviceNameResolver , true , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
169171
170172 lr , err := ls .Lookup ("my-topic" )
171173 assert .NoError (t , err )
@@ -185,9 +187,10 @@ func TestLookupWithProxy(t *testing.T) {
185187
186188 expectedRequests : []pb.CommandLookupTopic {
187189 {
188- RequestId : proto .Uint64 (1 ),
189- Topic : proto .String ("my-topic" ),
190- Authoritative : proto .Bool (false ),
190+ RequestId : proto .Uint64 (1 ),
191+ Topic : proto .String ("my-topic" ),
192+ Authoritative : proto .Bool (false ),
193+ AdvertisedListenerName : proto .String ("" ),
191194 },
192195 },
193196 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -199,7 +202,7 @@ func TestLookupWithProxy(t *testing.T) {
199202 ProxyThroughServiceUrl : proto .Bool (true ),
200203 },
201204 },
202- }, url , serviceNameResolver , false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
205+ }, url , serviceNameResolver , false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
203206
204207 lr , err := ls .Lookup ("my-topic" )
205208 assert .NoError (t , err )
@@ -218,9 +221,10 @@ func TestTlsLookupWithProxy(t *testing.T) {
218221
219222 expectedRequests : []pb.CommandLookupTopic {
220223 {
221- RequestId : proto .Uint64 (1 ),
222- Topic : proto .String ("my-topic" ),
223- Authoritative : proto .Bool (false ),
224+ RequestId : proto .Uint64 (1 ),
225+ Topic : proto .String ("my-topic" ),
226+ Authoritative : proto .Bool (false ),
227+ AdvertisedListenerName : proto .String ("" ),
224228 },
225229 },
226230 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -232,7 +236,7 @@ func TestTlsLookupWithProxy(t *testing.T) {
232236 ProxyThroughServiceUrl : proto .Bool (true ),
233237 },
234238 },
235- }, url , NewPulsarServiceNameResolver (url ), true , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
239+ }, url , NewPulsarServiceNameResolver (url ), true , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
236240
237241 lr , err := ls .Lookup ("my-topic" )
238242 assert .NoError (t , err )
@@ -252,14 +256,16 @@ func TestLookupWithRedirect(t *testing.T) {
252256
253257 expectedRequests : []pb.CommandLookupTopic {
254258 {
255- RequestId : proto .Uint64 (1 ),
256- Topic : proto .String ("my-topic" ),
257- Authoritative : proto .Bool (false ),
259+ RequestId : proto .Uint64 (1 ),
260+ Topic : proto .String ("my-topic" ),
261+ Authoritative : proto .Bool (false ),
262+ AdvertisedListenerName : proto .String ("" ),
258263 },
259264 {
260- RequestId : proto .Uint64 (2 ),
261- Topic : proto .String ("my-topic" ),
262- Authoritative : proto .Bool (true ),
265+ RequestId : proto .Uint64 (2 ),
266+ Topic : proto .String ("my-topic" ),
267+ Authoritative : proto .Bool (true ),
268+ AdvertisedListenerName : proto .String ("" ),
263269 },
264270 },
265271 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -276,7 +282,7 @@ func TestLookupWithRedirect(t *testing.T) {
276282 BrokerServiceUrl : proto .String ("pulsar://broker-1:6650" ),
277283 },
278284 },
279- }, url , NewPulsarServiceNameResolver (url ), false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
285+ }, url , NewPulsarServiceNameResolver (url ), false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
280286
281287 lr , err := ls .Lookup ("my-topic" )
282288 assert .NoError (t , err )
@@ -296,14 +302,16 @@ func TestTlsLookupWithRedirect(t *testing.T) {
296302
297303 expectedRequests : []pb.CommandLookupTopic {
298304 {
299- RequestId : proto .Uint64 (1 ),
300- Topic : proto .String ("my-topic" ),
301- Authoritative : proto .Bool (false ),
305+ RequestId : proto .Uint64 (1 ),
306+ Topic : proto .String ("my-topic" ),
307+ Authoritative : proto .Bool (false ),
308+ AdvertisedListenerName : proto .String ("" ),
302309 },
303310 {
304- RequestId : proto .Uint64 (2 ),
305- Topic : proto .String ("my-topic" ),
306- Authoritative : proto .Bool (true ),
311+ RequestId : proto .Uint64 (2 ),
312+ Topic : proto .String ("my-topic" ),
313+ Authoritative : proto .Bool (true ),
314+ AdvertisedListenerName : proto .String ("" ),
307315 },
308316 },
309317 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -320,7 +328,7 @@ func TestTlsLookupWithRedirect(t *testing.T) {
320328 BrokerServiceUrlTls : proto .String ("pulsar+ssl://broker-1:6651" ),
321329 },
322330 },
323- }, url , NewPulsarServiceNameResolver (url ), true , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
331+ }, url , NewPulsarServiceNameResolver (url ), true , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
324332
325333 lr , err := ls .Lookup ("my-topic" )
326334 assert .NoError (t , err )
@@ -339,9 +347,10 @@ func TestLookupWithInvalidUrlResponse(t *testing.T) {
339347
340348 expectedRequests : []pb.CommandLookupTopic {
341349 {
342- RequestId : proto .Uint64 (1 ),
343- Topic : proto .String ("my-topic" ),
344- Authoritative : proto .Bool (false ),
350+ RequestId : proto .Uint64 (1 ),
351+ Topic : proto .String ("my-topic" ),
352+ Authoritative : proto .Bool (false ),
353+ AdvertisedListenerName : proto .String ("" ),
345354 },
346355 },
347356 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -353,7 +362,7 @@ func TestLookupWithInvalidUrlResponse(t *testing.T) {
353362 ProxyThroughServiceUrl : proto .Bool (false ),
354363 },
355364 },
356- }, url , NewPulsarServiceNameResolver (url ), false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
365+ }, url , NewPulsarServiceNameResolver (url ), false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
357366
358367 lr , err := ls .Lookup ("my-topic" )
359368 assert .Error (t , err )
@@ -369,9 +378,10 @@ func TestLookupWithLookupFailure(t *testing.T) {
369378
370379 expectedRequests : []pb.CommandLookupTopic {
371380 {
372- RequestId : proto .Uint64 (1 ),
373- Topic : proto .String ("my-topic" ),
374- Authoritative : proto .Bool (false ),
381+ RequestId : proto .Uint64 (1 ),
382+ Topic : proto .String ("my-topic" ),
383+ Authoritative : proto .Bool (false ),
384+ AdvertisedListenerName : proto .String ("" ),
375385 },
376386 },
377387 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -381,7 +391,7 @@ func TestLookupWithLookupFailure(t *testing.T) {
381391 Authoritative : proto .Bool (true ),
382392 },
383393 },
384- }, url , NewPulsarServiceNameResolver (url ), false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
394+ }, url , NewPulsarServiceNameResolver (url ), false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
385395
386396 lr , err := ls .Lookup ("my-topic" )
387397 assert .Error (t , err )
@@ -468,7 +478,7 @@ func TestGetPartitionedTopicMetadataSuccess(t *testing.T) {
468478 Response : pb .CommandPartitionedTopicMetadataResponse_Success .Enum (),
469479 },
470480 },
471- }, url , serviceNameResolver , false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
481+ }, url , serviceNameResolver , false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
472482
473483 metadata , err := ls .GetPartitionedTopicMetadata ("my-topic" )
474484 assert .NoError (t , err )
@@ -486,9 +496,10 @@ func TestLookupSuccessWithMultipleHosts(t *testing.T) {
486496
487497 expectedRequests : []pb.CommandLookupTopic {
488498 {
489- RequestId : proto .Uint64 (1 ),
490- Topic : proto .String ("my-topic" ),
491- Authoritative : proto .Bool (false ),
499+ RequestId : proto .Uint64 (1 ),
500+ Topic : proto .String ("my-topic" ),
501+ AdvertisedListenerName : proto .String ("" ),
502+ Authoritative : proto .Bool (false ),
492503 },
493504 },
494505 mockedResponses : []pb.CommandLookupTopicResponse {
@@ -499,7 +510,7 @@ func TestLookupSuccessWithMultipleHosts(t *testing.T) {
499510 BrokerServiceUrl : proto .String ("pulsar://broker-1:6650" ),
500511 },
501512 },
502- }, url , serviceNameResolver , false , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
513+ }, url , serviceNameResolver , false , "" , log .DefaultNopLogger (), NewMetricsProvider (map [string ]string {}))
503514
504515 lr , err := ls .Lookup ("my-topic" )
505516 assert .NoError (t , err )
0 commit comments