@RunWith(SpringRunner.class)
@SpringBootTest(classes=MyApplication.class)
@TestPropertySource(locations = "classpath:test-application.properties")
@WebAppConfiguration
@RestClientTest(Controller.class)
public class MyIntegrationTest {
}
当我运行此程序时,出现以下错误java.lang.IllegalStateException:配置错误:为测试类找到了@BootstrapWith的多个声明
您到底想测试什么?如果确实只有RestClientTest
,则应该可以使用:
@RunWith(SpringRunner.class)
@TestPropertySource(locations = "classpath:test-application.properties")
@RestClientTest(Controller.class)
public class MyIntegrationTest {
}