You are previewing Spring in Practice.

Spring in Practice

Cover of Spring in Practice by Willie Wheeler with Joshua White Published by Manning Publications
O'Reilly logo

Chapter 10. Integration testing

This chapter covers

  • Maven configuration for Spring integration testing
  • Writing transactional happy-path tests
  • Creating exception and performance tests

Ideally, testing is a core activity of the practicing software developer, and it so happens that the dependency-injection approach to software design is especially useful in the testing arena. Dependency injection is particularly useful in unit testing, where you desire to test small units of code in isolation from other code. With dependency injection you can inject mock dependencies with prescribed behavior into code units, which allows you to isolate faults to the code under test.

A step up from unit testing is integration testing. The idea here is to ...

The best content for your career. Discover unlimited learning on demand for around $1/day.