首先Junit5依赖应该配置为
<dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>RELEASE</version> </dependency>
其次在Junit5中无发使用RunWith注解,应用以下配置
@ExtendWith(SpringExtension.class)
Junit5其它部分注解变化:
Before>>BeforeEach
After>>AfterEach
Ignore>>Disabled
........