KAFKA-14133: Migrate StandbyTaskCreator mock in TaskManagerTest to Mockito#13711
KAFKA-14133: Migrate StandbyTaskCreator mock in TaskManagerTest to Mockito#13711divijvaidya merged 2 commits intoapache:trunkfrom
Conversation
|
@clolov Could you please do the mentioned rebase? |
|
Could you also please add some more info to the PR description instead of only referencing other PRs? One or two sentences followed by the references is totally fine. |
There was a problem hiding this comment.
nit: Why did you introduce variable standbyTasks? The variable is not used anywhere else.
There was a problem hiding this comment.
I do not think you need this verification since also with EasyMock the call is not verified (i.e., verify() on the mock is never called).
There was a problem hiding this comment.
To be honest, here I followed what was done in PR #13681
For example, the original in the mentioned PR was.
...
expect(activeTaskCreator.createTasks(consumer, Collections.emptyMap())).andReturn(emptySet());
...
and with Mockito we changed it to
...
Mockito.verify(activeTaskCreator).createTasks(consumer, Collections.emptyMap());
...
I followed the same logic for what I thought was a stronger verification, but I am happy to remove it if you think it is unnecessary. I realise the reasoning for doing the above in that PR might have made more sense because there was more than one argument.
Let me know!
There was a problem hiding this comment.
Oh, I see what you mean. You mean that in the EasyMock version there are no calls to
verify(standbyTaskCreator)
in the these specific tests.
Yeah, sure, I will change it!
There was a problem hiding this comment.
Also here, I do not think you need to verify.
There was a problem hiding this comment.
Also here no verification needed.
|
Yup, I will address all comments today, thank you for the review! |
|
Heya @cadonna, I hope I have addressed all of your comments:
Interestingly enough the test |
|
The issue with |
67cf39c to
92fb1aa
Compare
|
Okay, the name has been changed and this has been rebased. I ran checkstyleTest and spotbugsTest and they are passing locally. If everything passes in the automated tests you should be able to merge it at your leisure! |
|
Good morning! I believe that the failing checks are not connected with this change. Is it okay to merge this PR? |
|
Failing tests are not related. Merging this code. |
This pull requests migrates the StandbyTaskCreator mock in TaskManagerTest from EasyMock to Mockito.
The change is restricted to a single mock to minimize the scope and make it easier for review.
The reasoning as to why we would like to migrate a single mock rather than all mocks in the file at the same time has been discussed in #12607 (comment)
It takes the same approach as in:
#13529
#13621
#13681
This needs to be rebased on top of #13681 before merging