Skip to content
Ameen Abozaid
Planned lessonJNR-016-L07

Demo: slice vs full-context tests, timed

  • Lesson 7 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

measure the difference; prepares JNR-016-LAB1.

Draft outline details

Step by step

  1. Run the controller slice tests and note the time.
  2. Write the same check as a @SpringBootTest with @AutoConfigureMockMvc; run and note the time.
  3. Run both classes together; show the cached context being reused.
  4. Planned mistake: convert every controller test to @SpringBootTest "to be safe"; the suite becomes several times slower. Fix: keep slices; keep one full-context smoke test.
  5. Summarize the rule: slice for one layer, full context for wiring and end-to-end.

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.

Type to search levels, phases, modules and lessons.