Every week in my Tuesday Lunch & Learn livestream, we choose a useful software development skill, define a challenge related to that skill, and solve the challenge live. This week, we’re finishing our two-part series on testing microservice clients.
In today’s episode, we finish off our ROT-13 tool by using last week’s generic
HttpClient class to build a dedicated client for our ROT-13 service. Calling the service is easy; the real challenge is making sure that our code is robust against errors. With services, anything that can go wrong, eventually will go wrong, so we need to make sure our code can handle anything.
In addition to handling errors, we also make sure that all our code can be tested without mocks. This involves making our ROT-13 client nullable and trackable, and we also program it to generate errors on command. This lets us test how our application code deals with client errors.
Visit the Lunch & Learn archive for more.