Skip to content
Ameen Abozaid
Planned lessonMID-010-L05

Demo: enforcing boundaries with ArchUnit

  • Lesson 5 of 5
  • Mid-level
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

make a forbidden dependency fail the build; prepares MID-010-LAB1.

Draft outline details

Step by step

  1. In Shop API, define feature packages: orders, catalog, payments.
  2. Add an ArchUnit test: classes in orders.. must not depend on payments.internal...
  3. Run it; it passes on the clean codebase.
  4. Planned mistake: import a payments internal class from orders. The test fails with a readable violation. Fix: call the public API of payments instead.
  5. Add a layering rule (controllers do not access repositories directly); verify the ArchUnit version for the API.

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.