spring 引导指南缺少自动配置
spring boot guide missing autoconfigure
我正在阅读 Spring 引导指南教程:
https://spring.io/guides/gs/spring-boot/
在添加单元测试的步骤中似乎已损坏。
class 遗漏了一些导入:
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.test.context.junit4.SpringRunner;
当然我可以手动搜索并添加maven包,但我想知道这个包是否足够?但是,如果我的代码有什么问题?
导游说,够了:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
感谢您提供任何信息!
好的...归根结底这是一个愚蠢的错字...
in pom.xml
in <parent> tag
I used the <version>1.2.3 ....
It works with <version>1.5.3 ....
对于给您带来的不便,我们深表歉意。
我正在阅读 Spring 引导指南教程: https://spring.io/guides/gs/spring-boot/
在添加单元测试的步骤中似乎已损坏。 class 遗漏了一些导入:
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.test.context.junit4.SpringRunner;
当然我可以手动搜索并添加maven包,但我想知道这个包是否足够?但是,如果我的代码有什么问题?
导游说,够了:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
感谢您提供任何信息!
好的...归根结底这是一个愚蠢的错字...
in pom.xml
in <parent> tag
I used the <version>1.2.3 ....
It works with <version>1.5.3 ....
对于给您带来的不便,我们深表歉意。