Skip to content
Ameen Abozaid
Planned lessonJNR-045-L06

Demo: Testcontainers integration tests for Shop

  • Lesson 6 of 7
  • Junior
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

add real-database tests for Shop. Prepares JNR-045-LAB1.

Draft outline details

Step by step

  1. Add Testcontainers and the PostgreSQL module dependencies (verify versions).
  2. Create a shared base configuration with a static container and @ServiceConnection.
  3. Write a @DataJpaTest for a custom product search query.
  4. Write a @SpringBootTest that creates an order and reads it back with migrations applied.
  5. Planned mistake: an H2 test passes but the same query fails on PostgreSQL because of a function difference; move it to the Testcontainers test.
  6. Run the suite with Docker only, on a clean checkout.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.