首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SpringBoot 2.2.2版本中的IntegrationTest和SpringApplicationConfiguration

SpringBoot 2.2.2版本中的IntegrationTest和SpringApplicationConfiguration
EN

Stack Overflow用户
提问于 2021-07-15 18:57:53
回答 1查看 25关注 0票数 0

我有一个包含以下依赖项的项目:

代码语言:javascript
运行
复制
<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>

还有这个类:

代码语言:javascript
运行
复制
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {MyApp.class})
@WebAppConfiguration
@org.springframework.boot.test.IntegrationTest
public class ServiceTest extends TestCase {

    public void testAllNames() {
    }
}

但是我有这个编译错误:

代码语言:javascript
运行
复制
Cannot resolve symbol 'IntegrationTest'
Cannot resolve symbol 'SpringApplicationConfiguration'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-15 19:05:20

从spring boot 1.x开始,IntegrationTest就被弃用了。您可以改用SpringBootTest

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68392559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档