Skip to Main Content
JUnit in Action, Third Edition
book

JUnit in Action, Third Edition

by Catalin Tudose
January 2021
Intermediate to advanced content levelIntermediate to advanced
560 pages
15h 13m
English
Manning Publications
Content preview from JUnit in Action, Third Edition

8 Testing with mock objects

This chapter covers

  • Introducing and demonstrating mock objects
  • Executing different refactorings with the help of mock objects
  • Practicing on an HTTP connection sample application
  • Working with and comparing the EasyMock, JMock, and Mockito frameworks

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

--Rich Cook

Unit testing each method in isolation from other methods or the environment is certainly a nice goal. How do you perform this task? You saw in chapter 7 that the stubbing technique lets you unit test portions of code by isolating them from the environment ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Test-Driven Java Development, Second Edition - Second Edition

Test-Driven Java Development, Second Edition - Second Edition

Viktor Farcic, Alex Garcia

Publisher Resources

ISBN: 9781617297045Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link