Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mockito versus Powermock

 
Rene Ummels
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tomek,

I use the following rule for usage of Mockito versus Powermock. In our company we use Mockito.

Rule: Do not use Powermock, unless it is really needed (think!). Use it per maven sub-project and then use it consistently (not using both Mockito and Powermock).
- Powermock shall never be used to hide bad design.
- Powermock is allowed in testing Abstract Factory.
- The Sonar check concerning final methods / classes is nonsense; how can you ever be sure that you are never going to extend a class or method? Conclusion: Do not use Powermock to test existing final methods or classes in your code but remove the final keyword.

Do you have any suggestions on my rule?
Any suggestions (adding text, removing text, changing text) or sharing thoughts are appreciated.


kind regards,
Rene Ummels
 
Billy Tsai
Ranch Hand
Posts: 1304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are Mockito and TestNG two totally different testing frameworks?
what are their main differenences?
 
Rene Ummels
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Billy,

Did you add your question(s) on purpose to my post, or did you do it by mistake?


///Rene
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic