recently I changed my spring boot properties to define a management port. In doing so, my unit tests started to fail :(
I wrote a unit test that tested the /
Did you try adding the following annotation to your test class?
@TestPropertySource(properties = {"management.port=0"})
Check the following link for reference.