Mocking Without Interfaces [Screencast]

There is a common misconception about mandatory interfaces for easy unit testing and mocking. This myth causes a lot of plumbing in Java EE projects. This screencast shows how to mock classes directly--without any interfaces:

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

Comments:

I use Mockite since 1 year now and I am very happy with it. Unfortunately Mockito cannot mock final classes and methods. Powermock is supposed to be able to mock final classes and methods but I did not try it out yet so I do not know if it has any additional drawbacks.

Posted by Christian on July 27, 2012 at 12:00 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License