Deep Dive110min
Spring Boot testing: Zero to Hero
This talk addresses common pitfalls in Spring Boot testing, such as overusing `@SpringBootTest`, leading to slow and unreliable test suites. It explores the comprehensive testing toolkit offered by Spring Boot, including slices testing, context caching, and HTTP testing, and highlights tools like Awaitility and AssertJ to enhance test architecture and efficiency.
Daniel Garnier-MoirouxSpring
talkDetail.whenAndWhere
Thursday, May 8, 11:20-13:10
Room A
You created your app from start.spring.io, you can run it, and you can also test it! Do you fondly remember your first encouter with first `@SpringBootTest`? Fast-forward 6 months and your test suite now takes 12 minutes to run, and randomly fails at least once a day. You have mocks everywhere, and your integration tests are 197 lines long.`@SpringBootTest` sparks joy, and brings great value, immediately. But it's so easy to splatter it everywhere that devs miss out on all there other testing utilities Spring Boot provides. They don't put enough thought into the architecture of their test suite, they don't make their tests easy to read and write, and they lose sight of the multiple goals that tests help us achieve: fast feedback, high confidence, support for design...In this talk, you will learn about the Spring Boot testing toolkit, through many live-coded examples. We'll talk about slices testing, context caching, custom test configuration, testcontainers integration, and all the HTTP testing capabilities. We will also dive into all the little gems that are bundled with Spring-Boot-Test, such as Awaitility, AssertJ, and more!
comments.speakerNotEnabledComments