You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2020/02/29 22:43:19 UTC

[kafka] branch 2.5 updated: MINOR: Fix unrelated types comparison in MetadataRequestTest (#8195)

This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch 2.5
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.5 by this push:
     new c3e4534  MINOR: Fix unrelated types comparison in MetadataRequestTest (#8195)
c3e4534 is described below

commit c3e453428c895bae10cd438cd4bd2b28a3f156b6
Author: Chia-Ping Tsai <ch...@gmail.com>
AuthorDate: Sun Mar 1 06:07:15 2020 +0800

    MINOR: Fix unrelated types comparison in MetadataRequestTest (#8195)
    
    The type of `leaderId` was changed to `Optional` in a recent change.
    
    Reviewers: Ismael Juma <is...@juma.me.uk>
---
 core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala b/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala
index 599ae17..ecb3f7e 100644
--- a/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala
+++ b/core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala
@@ -274,7 +274,7 @@ class MetadataRequestTest extends BaseRequestTest {
       val serverId = server.dataPlaneRequestProcessor.brokerId
       val leaderId = partitionMetadata.leaderId
       val replicaIds = partitionMetadata.replicaIds.asScala
-      serverId != leaderId && replicaIds.contains(serverId)
+      leaderId.isPresent && leaderId.get() != serverId && replicaIds.contains(serverId)
     }.get
     downNode.shutdown()