Instant Mock Testing with PowerMock

Writing good unit tests can be hard - make it easy with a quick start to PowerMock

Instant Mock Testing with PowerMock

Deep Shah

Writing good unit tests can be hard - make it easy with a quick start to PowerMock
eBook
$10.00
RRP $14.99
Save 33%
What do I get with a Mapt subscription?
  • Unlimited access to all Packt’s 6,000+ eBooks and Videos
  • 100+ new titles a month, learning paths, assessments & code files
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$10.00
RRP $14.99
eBook

Frequently bought together


Instant Mock Testing with PowerMock Book Cover
Instant Mock Testing with PowerMock
$ 14.99
$ 10.00
Mockito Cookbook Book Cover
Mockito Cookbook
$ 26.99
$ 10.00
Buy 2 for $20.00
Save $21.98
Add to Cart

Book Details

ISBN 139781783289950
Paperback82 pages

Book Description

Writing good unit tests can be hard in situations where we have to deal with static, final, or private methods. Sometimes, even a good design is sacrificed for the sake of testability. A mocking framework’s ability to create mocks for almost any scenario enables us to focus on accurately programming for a business environment.

Starting with a basic example of how to create a mock and verify a method invocation Instant Testing with PowerMock then demonstrates various features of PowerMock using clear, practical, step-by-step recipes. By the end of this book, you will be able to write unit tests for almost any scenario and suppress unwanted behaviour to effectively unit test your code.

Moving on from the basics, you will learn to write unit tests for static, final, and private methods, and write flexible unit tests using argument matchers. Following on from this, you will also learn how to mock a few methods of a class, and invoke real implementation of others using partial mocks or spies. This book will teach you the tricks of the trade that will enable you to write good unit tests for a wide range of scenarios.

What You Will Learn

  • Learn how to mock final classes and methods
  • Use argument matchers to write flexible tests
  • Invoke private methods and verify the internal state of a class
  • Suppress unwanted constructors, methods, fields, and static initializers
  • Set up mocking code once and use Mock Policies to avoid writing repetitive code

Authors

Book Details

ISBN 139781783289950
Paperback82 pages
Read More

Read More Reviews

These popular $10 titles might interest you

Mockito Cookbook Book Cover
Mockito Cookbook
$ 26.99
$ 10.00
Mastering Unit Testing Using Mockito and JUnit Book Cover
Mastering Unit Testing Using Mockito and JUnit
$ 26.99
$ 10.00
Selenium 1.0 Testing Tools: Beginner's Guide Book Cover
Selenium 1.0 Testing Tools: Beginner's Guide
$ 23.99
$ 10.00
Git: Version Control for Everyone Book Cover
Git: Version Control for Everyone
$ 23.99
$ 10.00
Instant Penetration Testing: Setting Up a Test Lab How-to Book Cover
Instant Penetration Testing: Setting Up a Test Lab How-to
$ 14.99
$ 10.00
Instant Google Map Maker Starter Book Cover
Instant Google Map Maker Starter
$ 9.99
$ 7.00