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.


NEW online workshop: WebStandards Igniter (online)

Airport MUC workshops: Java EE 8, Java 9: Bootstrap, Effective, Architectures, Single Page Apps, Progressive Web Apps, HTML 5, ES 6, CSS 3 and Microservices

Podcast: airhacks.fm and newsletter: airhacks.news

A book about rethinking Java EE Patterns

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
realworldpatterns.com
Online Workshops
...the last 150 posts
...the last 10 comments
License