SpringBoot 2.2 中的 IntegrationTest 和 SpringApplicationConfiguration。2.RELEASE

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>

和这个 class:

@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 已弃用正弦 spring 启动 1.x。您可以改用 SpringBootTest