Development PracticesDevelopment Practices
Deep Dive180min
BEGINNER

Spring Boot testing: Zero to Hero

This talk focuses on enhancing understanding and use of the Spring Boot testing toolkit, beyond the commonly used @SpringBootTest. The session will cover aspects like slices testing, context caching, custom test configuration, and HTTP testing capabilities, through live-coded examples. It will also explore JUnit's capabilities beyond @BeforeEach & @Test, and delve into additional tools bundled with Spring-Boot-Test, such as Awaitility and JSONassert. The goal is to encourage best testing practices within the Spring framework, emphasizing test suite architecture, readability, and effectiveness.

Daniel Garnier-Moiroux
Daniel Garnier-MoirouxSpring @ Broadcom

talkDetail.whenAndWhere

Monday, October 7, 09:30-12:30
Room 5
talks.description
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.
JUnit
Test best practices
Spring Boot testing toolkit
@SpringBootTest
talks.speakers
Daniel Garnier-Moiroux

Daniel Garnier-Moiroux

Spring @ Broadcom

France

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.
comments.title

comments.speakerNotEnabledComments