Skip to content
Ameen Abozaid
Planned lessonJNR-012-L05

Demo: typed, validated ShopProperties that fail fast

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

build ShopProperties, see it fail on bad input; prepares JNR-012-LAB1.

Draft outline details

Step by step

  1. Create the ShopProperties record and enable scanning.
  2. Add shop.currency, shop.tax-rate, shop.page-size-max to application.yml; inject the record into a service.
  3. Add dev and prod profile files with different values.
  4. Planned mistake: set tax-rate: 1.5; the app refuses to start. Read the message ("Binding to target ... failed") and the property name; fix the value.
  5. Override the value with an environment variable and show it winning.

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.