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

@RunWith(SpringRunner.class) is caused by the lack of Junit dependency in the pom file.
Solution:
add the following dependencies in 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>

Guess you like

Origin blog.csdn.net/weixin_44182157/article/details/108962087