You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Josep Prat (Jira)" <ji...@apache.org> on 2021/06/15 12:27:00 UTC

[jira] [Commented] (KAFKA-12950) Replace EasyMock and PowerMock with Mockito for KafkaStreamsTest

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

Josep Prat commented on KAFKA-12950:
------------------------------------

I took a look at this for a while. Unfortunately, my Mockito knowledge is somewhat limited and, as far as I understand, some of the features used with PowerMock are not available in Mockito.

For example, PowerMock is used in KafkaStreamsTest in a "highjacking" mode, basically redefining behaviors "globaly for the test".

AFAIU, with Mockito's mocks, one needs to use the returned mocked object in order to benefit for the overridden behaviour, for example.

The only way I can think of solving this, is by a considerable refactoring of KafkaStreams itself, so it's easier to be tested (with or without mocks).

 

I'm unassigning myself from this task in case someone with a deeper Mockito knowledge has a better solution.

> Replace EasyMock and PowerMock with Mockito for KafkaStreamsTest
> ----------------------------------------------------------------
>
>                 Key: KAFKA-12950
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12950
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: Josep Prat
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)