You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/01 12:58:00 UTC

[jira] [Commented] (KAFKA-6363) Use MockAdminClient for any unit tests that depend on AdminClient

    [ https://issues.apache.org/jira/browse/KAFKA-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307433#comment-16307433 ] 

ASF GitHub Bot commented on KAFKA-6363:
---------------------------------------

h314to opened a new pull request #4371: KAFKA-6363: Use MockAdminClient for any unit tests that depend on Adm…
URL: https://github.com/apache/kafka/pull/4371
 
 
   …inClient
   
   * Implement MockAdminClient.deleteTopics
   * Use MockAdminClient instead of MockKafkaAdminClientEnv in StreamsResetterTest
   * Rename MockKafkaAdminClientEnv to AdminClientUnitTestEnv
   * Use MockAdminClient instead of MockKafkaAdminClientEnv in TopicAdminTest
   * Rename KafkaAdminClient to AdminClientUnitTestEnv in KafkaAdminClientTest.java
   * Migrate StreamThreadTest to MockAdminClient
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Use MockAdminClient for any unit tests that depend on AdminClient
> -----------------------------------------------------------------
>
>                 Key: KAFKA-6363
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6363
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Guozhang Wang
>              Labels: newbie
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)