在单元测试类中修改@SpringBootTest的内容如下:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)