IntegrationTest & SpringApplicationConfiguration in SpringBoot 2.2.2.RELEASE



我有一个项目具有以下依赖项:

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

这一类:

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {MyApp.class})
@WebAppConfiguration
@org.springframework.boot.test.IntegrationTest
public class ServiceTest extends TestCase {
public void testAllNames() {
}
}

但是我有一个编译错误:

Cannot resolve symbol 'IntegrationTest'
Cannot resolve symbol 'SpringApplicationConfiguration'

IntegrationTest已弃用正弦弹簧引导1.x。您可以改用SpringBootTest

相关内容

最新更新