mimaison commented on code in PR #18364: URL: https://github.com/apache/kafka/pull/18364#discussion_r1905217594
########## core/src/test/scala/unit/kafka/cluster/PartitionTest.scala: ########## @@ -1693,20 +1690,13 @@ class PartitionTest extends AbstractPartitionTest { val replicas = List(brokerId, remoteBrokerId) val isr = Set(brokerId) - val metadataCache: MetadataCache = if (kraft) mock(classOf[KRaftMetadataCache]) else mock(classOf[ZkMetadataCache]) - if (kraft) { - addBrokerEpochToMockMetadataCache(metadataCache.asInstanceOf[KRaftMetadataCache], replicas) - } + val metadataCache: MetadataCache = mock(classOf[KRaftMetadataCache]) Review Comment: We can use `KRaftMetadataCache` as the type so we don't need the multiple `asInstanceOf` calls later -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org