Week 6

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:

  1. Unit tests vs integration tests — what's the difference
  2. Why integration tests for APIs — testing the full request/response cycle
  3. @SpringBootTest — loading the full application context
  4. Test REST client: MockMvc or TestRestTemplate
  5. Writing a test for a GET endpoint
  6. Writing a test for a POST endpoint with request body
  7. Asserting on status codes, response bodies, headers
  8. Using a test database (H2 in-memory or Testcontainers with PostgreSQL)
  9. Test data setup and cleanup
  10. Exercise: write integration tests for the Week 4 milestone API

The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

CC BY-NC-SA 4.0 Icons

*https://hackyourfuture.net/*

Found a mistake or have a suggestion? Let us know in the feedback form.