You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Philip Nee (Jira)" <ji...@apache.org> on 2023/11/28 19:38:00 UTC

[jira] [Updated] (KAFKA-15913) Remove excessive use of spy in CosumerTestBuilder

     [ https://issues.apache.org/jira/browse/KAFKA-15913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Philip Nee updated KAFKA-15913:
-------------------------------
        Parent: KAFKA-14246
    Issue Type: Sub-task  (was: Improvement)

> Remove excessive use of spy in CosumerTestBuilder
> -------------------------------------------------
>
>                 Key: KAFKA-15913
>                 URL: https://issues.apache.org/jira/browse/KAFKA-15913
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Philip Nee
>            Priority: Minor
>
> ConsumerTestBuilder is meant to be an unit testing utility; however, we seem to use Mockito#spy quite liberally.  This is not the right testing strategy because we basically turn unit testing into integration testing.
>  
> While the current unit tests run fine, we should probably make the mocking using Mockito#mock by default and test each dependency independently.
>  
> The ask here is
>  # Make mock(class) by default
>  # Provide more flexible interface for the testBuilder to allow user to configure spy or mock.  Or, let user pass in their own mock.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)