Conditionally ignoring tests in JUnit 4

后端 未结 5 1103
醉酒成梦
醉酒成梦 2020-11-22 13:38

OK, so the @Ignore annotation is good for marking that a test case shouldn\'t be run.

However, sometimes I want to ignore a test based on runtime inform

5条回答
  •  野性不改
    2020-11-22 14:24

    A quick note: Assume.assumeTrue(condition) ignores rest of the steps but passes the test. To fail the test, use org.junit.Assert.fail() inside the conditional statement. Works same like Assume.assumeTrue() but fails the test.

提交回复
热议问题