配置
@WebIntegrationTest(randomPort = true)
可以替代
@IntegrationTest(“server.port:0”)
@WebAppConfiguration
完整实例
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = DemoApplication.class)
@WebIntegrationTest
@ActiveProfiles("local")