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.

5 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.

  • Epson Printer Help Number UK +44-800-046-5077 Epson Printer Helpline responded:

    Thanks for sharing the amazing post with us. This is one of the great post

  • johan seena responded:

    The post is absolutely fantastic! Lots of great information and inspiration both of which we all need! Also like to admire the time and effort you put into your blog. For more info visit

Add your own comment...


    Twitter Button from twitbuttons.com