This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Static method partial mocking. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Static method partial mocking." Watch "Static method partial mocking." New topic

Static method partial mocking.

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 410

We are using PowerMock for unit testing. I could not find partial mocking for static methods. I have seen this which says that PowerMock contains a method called mockStaticPartials but I couldn't find this method. Can you help me to mock a specific method of static class?

Pawan Chopra
Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

PowerMock is an extension for either EasyMock or Mockito. Are you sure you're using Mockito version?
I agree. Here's the link:
subject: Static method partial mocking.
Similar Threads
PowerMock Test mechanism error
mocking private static methods with PowerMock
TestNG vs JUnit, mockito + Powermock vs jmockit
PowerMock: StackOverFlow
Mocking final class with Powermock + Easymock + testNG