Specify embedded Redis URI / port in Micronaut tests

Just a quick tip: If you need to specify the embedded Redis URI for Micronaut tests (e.g. when testing connectivity to Redis), then you just have to write the following in application.yml:

redis.embedded:
    uri: redis://localhost:1337

Here is how to set the port:

redis.embedded:
    port: 1337

You can just open EmbeddedRedisServer from micronaut-redis-lettuce and check out the code yourself.

Published by Anders Aaberg

IT-development consultant at Nine A/S MSc. Advanced Computer Science @ University of Leeds, UK

Leave a comment

Your email address will not be published. Required fields are marked *