Set the rsocket port to 0, for instance:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"spring.rsocket.server.port=0"}) public class MyControllerTest { // your test goes here }