Unit tests are awesome! They are small, they run fast, and they require little maintenance. Most importantly, unit tests run your code in isolation and thereby provide feedback on its design. However, what if you cannot get your code under test? Your design obviously needs improvement, but what if you cannot change that? You write an integration test, or you look into Mocking.
Mocking has a bad reputation, but it can come in handy and even save your day. In this workshop, you’ll use *Mockito* to unit test a small Java program with mocks, stubs, and spies. You’ll apply advanced mocking techniques to cope with complicated designs, and use matchers for less coupling to implementation details. You’ll learn about different types of dependencies and how mocks help to run them against assertions or even with behaviour verification. In the end, we’ll review common myths about mocking and discuss your new experience with a cold beer. Mock responsibly!