Nick Fisher's tech blog

Testing

How to use a Redis Test Container with Lettuce/Spring Boot Webflux

The source code for this post can be found on Github.

Another way to write integration tests for code that verifies your interactions with redis actually make sense is to use a test container. This framework assumes you have docker up and running, but if you do it will pull a specified container image [typically you’ll just use docker hub, though it’s important to note that they rate limit you, so don’t go overboard], then you can interact with that container in your integration tests.

A Guide to Automatic Retries in Reactor

The source code for this post is available on GitHub.

One of the nice things about a reactive programming model is there is a significantly lower risk of doomsday when things start getting latent all at once. You don’t have threads upstream blocking and waiting for a response, therefore they won’t all seize up and stop serving requests [or they won’t short circuit if you’re using a resiliency library like hystrix].

How to Configure Rest Assured to Record the Latency of Every Request In a Custom Way

Sample code associated with this post can be found on Github.

Rest Assured is a library that makes it easy to write api based automated tests in java. Recently I needed to find a way to record the latency of each request as well as some metadata about it [request path, method, things of that nature]. I found a nice way to do this with rest assured filters, and I’m going to share that with you in this article.