
[英]How to ignore @EnableWebSecurity annotated class in @WebMvcTest tests
[英]IntelliJ runs Kotlin tests annotated with @Ignore
我有一个使用JUnit 5.2.0的Kotlin项目。 当我使用IntelliJ运行测试时,它会运行所有测试,即使是使用@org.junit.Ignore
注释的测试。
package my.package
import org.junit.Ignore
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class ExampleTests {
@Test fun runMe() {
assertEquals(1, 1)
}
@Test @Ignore fun dontRunMe() {
assertEquals(1, 0)
}
}
谁能向我解释为什么会这样?
在JUnit 5中,您需要为此使用@Disabled注释。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.