kevin-wu24 commented on code in PR #22680:
URL: https://github.com/apache/kafka/pull/22680#discussion_r4349978305


##########
metadata/src/test/java/org/apache/kafka/metadata/MetadataCacheTest.java:
##########
@@ -508,6 +504,65 @@ public void 
getAliveBrokersShouldNotBeMutatedByUpdateCache() {
         }
     }
 
+    @Test
+    public void 
testGetPartitionLeaderEndpointForKnownPartitionWithoutEndpoint() {
+        MetadataCache cache = createCache();
+        ListenerName listenerName = 
ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT);
+        String topic = "topic";
+        Uuid topicId = Uuid.randomUuid();
+
+        List<ApiMessage> records = List.of(
+            new RegisterBrokerRecord()
+                .setBrokerId(0)
+                .setBrokerEpoch(BROKER_EPOCH)
+                .setFenced(false)
+                .setEndPoints(new BrokerEndpointCollection(List.of(

Review Comment:
   I think we need to also add `.setRack(null)` to make this test pass. 
Otherwise the first assertion fails.



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