首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到SpringRunner依赖类

找不到SpringRunner依赖类
EN

Stack Overflow用户
提问于 2016-08-22 16:05:04
回答 7查看 21.6K关注 0票数 3

我找不到哪个jar会为我提供SpringRunner.class的依赖项

我正在尝试将我的集成测试升级到spring-boot 1.4.0

EN

回答 7

Stack Overflow用户

发布于 2016-08-22 16:10:07

SpringRunner.java位于spring-test-4.3.2.RELEASE.jar文件中。

为了在Maven或Gradle项目中使用它,您应该声明对org.springframework.boot:spring-boot-starter-test的依赖。

以下是org.springframework.boot:spring-boot-starter-test所依赖的库:

代码语言:javascript
复制
+--- org.springframework.boot:spring-boot-starter-test: -> 1.4.0.RELEASE
|    +--- org.springframework.boot:spring-boot-test:1.4.0.RELEASE
|    |    \--- org.springframework.boot:spring-boot:1.4.0.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-test-autoconfigure:1.4.0.RELEASE
|    |    +--- org.springframework.boot:spring-boot-test:1.4.0.RELEASE (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:1.4.0.RELEASE (*)
|    +--- com.jayway.jsonpath:json-path:2.2.0
|    |    +--- net.minidev:json-smart:2.2.1
|    |    |    \--- net.minidev:accessors-smart:1.1
|    |    |         \--- org.ow2.asm:asm:5.0.3
|    |    \--- org.slf4j:slf4j-api:1.7.16 -> 1.7.19
|    +--- junit:junit:4.12
|    |    \--- org.hamcrest:hamcrest-core:1.3
|    +--- org.assertj:assertj-core:2.5.0 -> 2.4.1
|    +--- org.mockito:mockito-core:1.10.19
|    |    +--- org.hamcrest:hamcrest-core:1.1 -> 1.3
|    |    \--- org.objenesis:objenesis:2.1 -> 2.2
|    +--- org.hamcrest:hamcrest-core:1.3
|    +--- org.hamcrest:hamcrest-library:1.3
|    |    \--- org.hamcrest:hamcrest-core:1.3
|    +--- org.skyscreamer:jsonassert:1.3.0
|    |    \--- org.json:json:20090211 -> 20140107
|    +--- org.springframework:spring-core:4.3.2.RELEASE
|    \--- org.springframework:spring-test:4.3.2.RELEASE
|         \--- org.springframework:spring-core:4.3.2.RELEASE

票数 6
EN

Stack Overflow用户

发布于 2017-06-21 23:14:40

尝试手动添加此导入:

导入org.springframework.test.context.junit4.SpringRunner;

票数 3
EN

Stack Overflow用户

发布于 2016-08-22 16:09:19

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

https://stackoverflow.com/questions/39074213

复制
相关文章

相似问题

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