Aggregations
Transactions
Indexes
Integrating with APIs
Integration Testing
Practice
Assignment
Back end Track
Under construction
<aside>
🚧
This page is currently under construction. Please check back later.
</aside>
Implementation plan:
- Unit tests vs integration tests — what's the difference
- Why integration tests for APIs — testing the full request/response cycle
@SpringBootTest — loading the full application context
- Test REST client:
MockMvc or TestRestTemplate
- Writing a test for a GET endpoint
- Writing a test for a POST endpoint with request body
- Asserting on status codes, response bodies, headers
- Using a test database (H2 in-memory or Testcontainers with PostgreSQL)
- Test data setup and cleanup
- Exercise: write integration tests for the Week 4 milestone API
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

*https://hackyourfuture.net/*
Found a mistake or have a suggestion? Let us know in the feedback form.