O'Reilly logo

Testing with JUnit by Frank Appel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with test doubles

Test doubles serve various purposes like indirect input provisioning, recording of indirect output, or immediate verification of interactions. So it can hardly be surprising that there are quite a few different types of double patterns. This section introduces them and gives examples of hand-written implementations, which should be a precious experience for a deep comprehension and the correct application of stand-in components.

Placeholder dummies

To get a component into a state that constitutes a test's precondition, it is sometimes necessary to satisfy dependencies to collaborators which do not actually contribute to the functionality under test. The only right to exist for these DOCs is to fill in argument lists to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required