@SpringBootTest(classes = ApiApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
在@SpringBootTest注解中加入webEnvironment SpringBootTest.WebEnvironment.RANDOM_PORT,即可解决
@SpringBootTest(classes = ApiApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
在@SpringBootTest注解中加入webEnvironment SpringBootTest.WebEnvironment.RANDOM_PORT,即可解决