/spring-tdd-example

Spring TDD Example

Primary LanguageJava

Example of Top to Bottom TDD with Spring Boot


Source Quote:

Ever wonder how to test a hard problem like caching or write an integration test without making an external API call? Or come across a situation where testing something was so hard that it never got tested? A lot of developers today find themselves in situations where they are unsure of how to write light-weight unit tests. In our presentation, we will talk about how to do Test-driven development for a Spring Boot application and how some of the latest Spring Boot annotations and utilities make that easy. We will deep dive into some tricky real world testing scenarios that have baffled us in the past such as database queries, caching, reactive components, and message brokers.

Sannidhi Jalukar, Software Engineer, Pivotal
Madhura Bhave,  Software Engineer, Pivotal

Timeline:

  • 5:00 Integration test
  • 10:40 Controller Unit testing
  • 13:45 Controller creation
  • 14:46 Service unit testing
  • 19:05 Exception handler creation
  • 25:29 Repository unit testing
  • 51:28 Integration testing

Rewritten in JUnit5 + Extended with RestDocumentation


P8Z