Mocking final class with Powermock + Easymock + testNG
Atul A. Shah
posted 5 years ago
I'm new to PowerMock and can't find an example that matches my situation.
It's nothing complicated-- I am trying to use PowerMock+EasyMock to mock a final class in a TestNGtest.
Here's the final class:
The class under test delegates to an instance of the final class:
And here's the Test class:
But when I run the test, I get an illegal argument exception complaining that MyFinalClass is not an interface:
What am I missing? Thanks in advance for your help!!!