Chapter 1. Instant Mock Testing with PowerMock
Welcome to Instant Mock Testing with PowerMock. This book will demonstrate the effective use of this versatile open source mocking framework. The recipes described in this book will introduce most of the concepts of PowerMock (see http://code.google.com/p/powermock/) that will enable us to use it effectively.
PowerMock enables us to write good unit tests for even the most untestable code. Most of the mocking frameworks in Java cannot mock static methods or final classes. But using PowerMock, we can mock almost any class.