Things I Wish I Knew When I Started Testing Spring Boot Applications
summary
Spring Boot ships a testing Swiss army knife (starter-test pulling in JUnit 5, Mockito, AssertJ, Hamcrest, JSONassert, JsonPath) and recommends using focused slice annotations (e.g. @WebMvcTest, @JsonTest) instead of firing the whole context; overusing @SpringBootTest creates slow suites (contexts can take ~30s) and fragile mocks, and mixing JUnit 4 and JUnit 5 produces odd failures during migration; favor unit/slice tests, use Testcontainers or Testcontainers for real infra, and keep dependency management aligned.
AI-written summary · about
chapters (28)
- 0:00Intro
- 0:48How I got into testing
- 1:49University
- 2:13First Ticket
- 4:08About me
- 4:52Testing Swiss Army Knife
- 5:17Spring Boot Starter Test
- 5:51Dependency Tree
- 7:42Mokito
- 8:19SRJ
- 9:31Json assert
- 10:15Json path
- 10:37Dependency management
- 12:03Spring Bootest isnt always your friend
- 12:22Autogenerated tests
- 12:55Application context
- 14:53Spring Boot Test Obsession
- 16:55Spring Boot Tests All Over The Place
- 17:18Unit Tests
- 17:59Slicing
- 19:15Slice Annotations
- 21:02Webmdc Tests
- 22:07Mock MVC Tests
- 23:31Slice Annotation
- 25:10JUnit 5 Pitfall
- 27:48Summary
- 30:47Conclusion
- 32:28Outro
related talks
44mThings I Wish I Knew When I Started Testing Spring Boot Applications
53mTesting Spring Boot Applications Demystified
48mTesting Spring Boot Applications Demystified
51mTesting Spring Boot Applications
02h 43mSpring Boot testing: Zero to Hero
45mSpring Boot Test - A look behind the curtain
01h 49mSpring Boot testing: Zero to Hero
50mTesting with Spring and JUnit 5
