TaiJuWu commented on code in PR #18542:
URL: https://github.com/apache/kafka/pull/18542#discussion_r1920986488


##########
core/src/test/scala/unit/kafka/server/KafkaApisTest.scala:
##########
@@ -3612,175 +3569,6 @@ class KafkaApisTest extends Logging {
     assertEquals(Set(0), response.brokers.asScala.map(_.id).toSet)
   }
 
-
-  /**
-   * Metadata request to fetch all topics should not result in the followings:
-   * 1) Auto topic creation
-   * 2) UNKNOWN_TOPIC_OR_PARTITION
-   *
-   * This case is testing the case that a topic is being deleted from 
MetadataCache right after
-   * authorization but before checking in MetadataCache.
-   */
-  @Test
-  def 
testGetAllTopicMetadataShouldNotCreateTopicOrReturnUnknownTopicPartition(): 
Unit = {

Review Comment:
   Thinking this question....
   I am not really sure but the key which the case want to test is follow code 
and it is for ZK.
   ```
   var createTopicIsCalled: Boolean = false
       // Specific mock on zkClient for this use case
       // Expect it's never called to do auto topic creation
       when(zkClient.setOrCreateEntityConfigs(
         ArgumentMatchers.eq(ConfigType.TOPIC),
         anyString,
         any[Properties]
       )).thenAnswer(_ => {
         createTopicIsCalled = true
       })
       // No need to use
       when(zkClient.getAllBrokersInCluster)
         .thenReturn(Seq(new Broker(
           brokerId, "localhost", 9902,
           ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT), 
SecurityProtocol.PLAINTEXT
         )))
   ```



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