Link Details

Link 293115 thumbnail
User 284120 avatar

By matixo
via tech.mrozewski.pl
Published: Nov 17 2009 / 09:08

A simple example of using PowerMock and Mockito for mocking static Java methods.
  • 17
  • 1
  • 1650
  • 347

Comments

Add your comment
User 201874 avatar

Jim Bethancourt replied ago:

0 votes Vote down Vote up Reply

If I could vote 10 times I would do it in a heartbeat! PowerMock + Mockito is AMAZING!!!

User 251382 avatar

Chandru replied ago:

0 votes Vote down Vote up Reply

I agree totally. PowerMock is absolutely amazing. It can even be used to mock static methods in system classes, as I had posted before here http://www.dzone.com/links/mocking_mathrandom_using_powermock.html.

User 284120 avatar

Mateusz Mrozewski replied ago:

0 votes Vote down Vote up Reply

@chandru.in
Thanks for the link, it's a great post also. Very useful tip.

User 186143 avatar

majson replied ago:

0 votes Vote down Vote up Reply

I'm just wondering about the reason for "vote down" by baszero. Is it against usage of static methods at all, described tools or the blog post itself?
,

User 284120 avatar

Mateusz Mrozewski replied ago:

0 votes Vote down Vote up Reply

I'm also wondering about the same :) Baszero, can you provide some more information? If you have any tips for improving that post I'm happy to listen :)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.