有效解决方案
在@SpringBootTest注解上添加webEnvironment的注解值:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
参考:
THE END
在@SpringBootTest注解上添加webEnvironment的注解值:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
参考: