aspose file tools*
The moose likes Testing and the fly likes Mocking final class with Powermock + Easymock + testNG Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mocking final class with Powermock + Easymock + testNG" Watch "Mocking final class with Powermock + Easymock + testNG" New topic
Author

Mocking final class with Powermock + Easymock + testNG

Atul A. Shah
Greenhorn

Joined: Aug 29, 2007
Posts: 4
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 TestNG test.
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!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mocking final class with Powermock + Easymock + testNG