Using Nullables

In this module, you’ll learn how to use Nullables to create fast, reliable tests of application-level code that depends on infrastructure. You’ll test-drive the implementation of HomePageController, the controller for a web page that uses a ROT-13 microservice to encode the user’s text.

Concepts

Download the slides and transcript here.

Direct links to patterns discussed in this module:

Primers

You may wish to familiarize yourself with these primers before starting on the exercises:

Exercise Setup

Start with the Pre-Course Setup. Then:

1. Check out the code

  1. Check out the exercise branch:
    • JavaScript: git checkout using-nullables-js
    • TypeScript: git checkout using-nullables-ts
  2. Create a custom branch for your changes:
    • git checkout -b my-using-nullables

2. Prepare to start working

  1. Open the exercise files:
    • src/www/home_page/_home_page_controller_test.js (or .ts)
    • src/www/home_page/home_page_controller.js (or .ts)
  2. Run the build watcher from the root of the repository:
    • Windows: .\watch.cmd quick
    • Mac/Linux: ./watch.sh quick
  3. Confirm that the build runs and ends with BUILD OK.

Exercises

The course is designed to have more exercises than you can finish in a single session, so don’t worry about finishing everything. Instead, work at your own pace and focus on understanding the material. If you get to the end of challenge #3, you’ll have covered the most important information.

  1. Challenge #1: Using Nullables
  2. Challenge #2a: Tracking Requests
  3. Challenge #2b: Dynamic Configuration
  4. Challenge #2c: Parsing the Request Body
  5. Challenge #3: Configuring Responses
  6. Challenge #4: Signature Shielding
  7. Challenge #5: Logging
  8. Challenge #6: Refactoring
  9. Challenge #7: Service Errors
  10. Challenge #8: Design Changes
  11. Challenge #9: Timeouts
  12. Bonus Challenges

Start with Challenge #1

Return to course overview