Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6363

Use MockAdminClient for any unit tests that depend on AdminClient

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Today we have a few unit tests other than KafkaAdminClientTest that relies on MockKafkaAdminClientEnv.

      About this class and MockKafkaAdminClientEnv, my thoughts:

      1. MockKafkaAdminClientEnv is actually using a MockClient for the inner KafkaClient; it should be only used for the unit test of KafkaAdminClient itself.

      2. For any other unit tests on classes that depend on AdminClient, we should be using the MockAdminClient that mocks the whole AdminClient.

      So I suggest 1) in TopicAdminTest use MockAdminClient instead; 2) in KafkaAdminClientTest use MockClient and added a new static constructor that takes a KafkaClient; 3) remove the MockKafkaAdminClientEnv.

      Attachments

        Issue Links

          Activity

            People

              h314to Filipe Agapito
              guozhang Guozhang Wang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: