An integration test verifies that multiple application components work together. Instead of replacing every dependency with a mock, it can exercise a running application, real framework infrastructure, and persistence components. section 12.3.3 section 13.1.3
A practical integration test typically follows one of these arrangements:
- Start Spring Boot with @SpringBootTest(webEnvironment = RANDOM_PORT), inject WebTestClient, and send requests to the running server. section 12.3.3
- Let Spring create the controller and inject a real repository, then assert the API response with JSONPath expressions. section 12.3.3
- Use @DataR2dbcTest to create an application context containing Spring Data R2DBC repositories, then verify reactive results with StepVerifier. section 13.1.3
Testing a live reactive endpoint
A test can request /api/tacos?recent, expect an HTTP 200 response and JSON array, then verify that the array contains three named tacos: Carnivore, Bovine Bounty, and Veg-Out. The injected WebTestClient already knows the randomly assigned server port. section 12.3.3






























