Skip to content

Remove PowerMock from nearly all samples, in favour of plain Mockito. #2853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2020

Conversation

eamonnmcmanus
Copy link
Member

Also use the more usual MockitoAnnotations.initMocks(this) rather than
Mockito.mockitoSession().initMocks(this). Remove some unnecessary
throws clauses. Pass a value through a second constructor rather than
bashing a field with PowerMock's Whitebox.

Also use the more usual `MockitoAnnotations.initMocks(this)` rather than
`Mockito.mockitoSession().initMocks(this)`. Remove some unnecessary
`throws` clauses. Pass a value through a second constructor rather than
bashing a field with PowerMock's Whitebox.
@eamonnmcmanus eamonnmcmanus requested a review from a team May 7, 2020 00:32
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 7, 2020
@eamonnmcmanus eamonnmcmanus requested a review from ace-n May 7, 2020 00:33
Copy link
Contributor

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@eamonnmcmanus is there anywhere it's still used? (We may want to be aware of that when writing the docs.)

@kurtisvg kurtisvg merged commit 934fdd9 into master May 7, 2020
@kurtisvg kurtisvg deleted the mockito2 branch May 7, 2020 03:35
@eamonnmcmanus
Copy link
Member Author

is there anywhere it's still used?

It's still used in SlackSlashCommand for the Whitebox functionality (which pokes test values into class and instance fields of the code under test). I think we can rewrite the test to avoid that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants