Chapter 5. Application Testing

In this chapter, we will cover the following topics:

  • Creating tests for MVC Controllers
  • Automatically configuring database schema and populating it with data
  • Creating tests using in-memory database with data fixtures
  • Creating tests using Mockito to mock DB
  • Writing tests using Cucumber
  • Writing tests using Spock

Introduction

In the previous chapters we did a lot of coding. We created a new Spring Boot application from scratch, added an MVC component to it, some database services, made a few tweaks to the application behavior, and even wrote our very own Spring Boot Starter. It is now time to take the next step and learn what kind of tools and capabilities Spring Boot offers when it comes to testing all this code and how well ...

Get Spring Boot Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.