Chapter 6. Contract tests

This chapter covers

  • Understanding and writing contract tests
  • Using consumer-driven contracts
  • Working with Pact JVM
  • Integrating with Arquillian

So far in this book, you’ve learned about unit, component, and integration tests. One thing they have in common is that they don’t test the entire application, but rather isolated parts of it. With unit tests, the unit under test consists of only one or a few classes; with integration tests, you test whether boundaries can connect to a real service. This is the first chapter in which you’ll write tests to understand the application as a whole. In this chapter, you’ll learn why it’s important to use contract tests to verify the entire system, and how to write them.

6.1. Understanding ...

Get Testing Java Microservices: Using Arquillian, Hoverfly, AssertJ, JUnit, Selenium, and Mockito now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.