Home arrow Blog

New tutorial! Mocking static methods with PowerMock

“Static methods are the death to testability”. I’m sure you’ve all heard someone say something along those lines. Heck, even Google has blogged about it (http://bit.ly/4mk3fP). And yet, it just doesn’t make sense to me. Static methods were added to the Java language for a reason. Just because most toolsets do not support testing of them doesn’t mean that static methods are bad. I think it means we need new toolsets. With that in mind, I want to introduce you to PowerMock. In this tutorial, you can read about how to mock static methods with an EasyMock like API using this great open source framework. Read more about it here.

3 Responses to “New tutorial! Mocking static methods with PowerMock”

  • https://www.writemyessayz.co/ responded:

    You are saying a surely true. I want to hear much more from you. The level of your thinking is great.

  • Brother Printer Support Number UK responded:

    Thanks a lot for your great words about this post.

  • math games responded:

    I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you.

Add your own comment...


    Twitter Button from twitbuttons.com