I\'ve developed an application in Java and I\'m trying to create unit tests using Powermockito (I should add that I\'m new to unit testing).
I have a class called Re
If doNothing()
isn't working you can hack it a bit using the PowerMockito.doAnswer()
. This lets you mock into void methods that are supposed to do something, like setting values, etc. If doNothing()
doesn't work, using a blank doAnswer()
should work fine.
Example:
PowerMockito.doAnswer(new org.mockito.stubbing.Answer