You created your app from start.spring.io, you can run it, and you can also test it! There's a @SpringBootTest test case, and things are quick and easy. 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 te architecture of their test suite, they don't make their tests easy to read and write, they lose sight of the multiple goals that tests help us achieve: fast feedback, high confidence, support for design...
In this talk, you'll learn about the entire 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'll see that JUnit can offer much more than @BeforeEach & @Test. We will also dive into all the little gems that are bundled with Spring-Boot-Test, such as Awaitility and JSONassert. You'll learn testing best practices - applied to Spring.
@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 te architecture of their test suite, they don't make their tests easy to read and write, they lose sight of the multiple goals that tests help us achieve: fast feedback, high confidence, support for design...
In this talk, you'll learn about the entire 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'll see that JUnit can offer much more than @BeforeEach & @Test. We will also dive into all the little gems that are bundled with Spring-Boot-Test, such as Awaitility and JSONassert. You'll learn testing best practices - applied to Spring.
Daniel Garnier-Moiroux
Spring @ Broadcom
Daniel Garnier is a software engineer at Broadcom, working in the identity space and on SSO for applications. He is an adjunct professor at Mines Paris, where he teaches CS and software engineering classes.
He contributes to Spring Security, and has a keen interest in automation and developer productivity.
He contributes to Spring Security, and has a keen interest in automation and developer productivity.