Skip to content
Advertisement

Spring Boot Integration test random free port

I am able to get Spring Boot integration to generate a random free port to launch itself on. But I also need a free port for Redis.

JavaScript

Any ideas on how to achieve this?

Advertisement

Answer

You can use Spring Framework’s SocketUtils to get an available port:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement