TDD with Spring Boot - Testing the Harder Stuff
summary
Builds a small Spring Boot URL shortener with two endpoints: shorten (returns a hash) and expand (resolves it). Uses Spring Boot Starter Test, MockMvc and @WebMvcTest with @MockBean for controller tests, Mockito and AssertJ for unit tests, @DataJpaTest with H2 to exercise JPA wiring, and proves @Cacheable plus application-level enable caching reduces repository calls to one. Adds RabbitMQ via RabbitTemplate and @RabbitListener to increment click counts and stabilizes the async integration test with awaitility, and all examples end up passing.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 4:51Goal
- 10:10URL Shortening
- 13:40Databases
- 23:15Caching
- 26:41Message Broker
- 32:42Live Coding
- 43:01Pivotal Munich
related talks
56mLearning Spring Boot with TDD
53mTesting Spring Boot Applications Demystified
02h 43mSpring Boot testing: Zero to Hero
59mTest Driven Development with Spring Boot - Sannidhi Jalukar, Madhura Bhave
48mTesting Spring Boot Applications Demystified
50mTesting Spring Boot Applications
01h 49mSpring Boot testing: Zero to Hero
46mHow John Started to Like TDD (Instead of Hating It)
