You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/09/26 16:49:40 UTC

[GitHub] [kafka] divijvaidya commented on pull request #11792: Replace EasyMock/PowerMock with Mockito in DistributedHerderTest

divijvaidya commented on PR #11792:
URL: https://github.com/apache/kafka/pull/11792#issuecomment-1258336831

   @C0urante I won't be able to pick this up until 16th Oct. If no one has picked this up my then, I would happily pick it up.
   
   A problem that is common amongst the tests that I am migrating (`WorkerSinkTaskTest` and `WorkerSinkTaskThreadedTest`) and this PR is the FIFO queue stubbing not available in `Mockito` as @jeff303 [mentioned earlier](https://github.com/apache/kafka/pull/11792#issuecomment-1078447241). The approach that I have taken up to resolve that is to use `OngoingStubbing<T>` and chaining the expectations on that. We can also do that for `void` method using: 
   ```
   doNothing().doThrow(exception).doNothing().when(mockedObject).methodThatReturnsVoid()
   ```
   
   Does anyone else have a better solution to this? In my scenario, I want to queue expectations for `consumer.poll` and `consumer.assignment()` methods.
   
   
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org