Error running 'Springboot02ApplicationTests.contextLoads': Failed to resolve org.junit.platform:junit-platform-launcher:1.6.2
这是因为maven中缺少个依赖,添加进去就好了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
添加进去后就ok了