Mockito Cookbook

More Information
Learn
  • Create beautiful tests using Mockito
  • Create mocks and spies in a number of ways
  • Implement best practices to perform tests with Mockito
  • Extend Mockito with other popular Java-based unit testing frameworks such as JUnit and PowerMock
  • Stub behavior of mocks and spies
  • Verify test doubles with Mockito
  • Write good tests using Mockito
  • Integrate Mockito with DI systems
  • Compare Mockito to other mocking frameworks
  • Verify the behavior of your system under test
About

Mockito is a testing framework that allows you to easily create test doubles (mocks) of the system under test's collaborators. You can use mocks to better simulate the behavioral patterns of your software in isolation to receive feedback from tests as soon as possible.

This book consists of recipes that depict the usage of a vast majority of Mockito functionalities in real-life examples. It goes beyond the documentation and covers how Mockito works and shows the steps to write effective tests using Mockito. This is a focused guide with lots of practical recipes of business issues and presentation of the entire test of the system. This book shows the use of Mockito's popular unit testing frameworks such as JUnit, PowerMock, TestNG, and so on.

Features
  • Implement best practices to perform tests with Mockito
  • Extend Mockito with other popular Java-based unit testing frameworks such as JUnit and Powermock
  • A focused guide with many recipes on testing your software using Mockito
Page Count 284
Course Length 8 hours 31 minutes
ISBN 9781783982745
Date Of Publication 23 Jun 2014

Authors

Marcin Grzejszczak

Marcin Grzejszczak is an experienced Java programmer. He is enthusiastic about clean coding and good design. He has contributed to several open source projects (Drools, Moco, Mockito, Spock, and so on) and to Groovy core. He is the co-organizer of the Warsaw Groovy User Group. He is a member of the Most Valuable Blogger program at DZone and Java Code Geeks.

_x000D_

Marcin is the author of Instant Mockito, Packt Publishing, and Drools Refcard at DZone. You can visit his blog, http://toomuchcoding.blogspot.com, or his home page, http://www.marcin.grzejszczak.pl. Or, you can follow him on Twitter at http://twitter.com/MGrzejszczak.