springboot报错---@RunWith(SpringRunner.class)

@RunWith(SpringRunner.class)因为缺乏pom文件里Junit依赖导致。
解决方法:
在pom.xml里添加以下依赖

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<!--<scope>test</scope> -->
		</dependency>

猜你喜欢

转载自blog.csdn.net/weixin_44182157/article/details/108962087
今日推荐