Why isn't my @BeforeClass method running?

后端 未结 5 1138
天涯浪人
天涯浪人 2020-12-05 13:00

I have the following code:

    @BeforeClass
    public static void setUpOnce() throws InterruptedException {
        fail(\"LOL\");
    }

A

5条回答
  •  既然无缘
    2020-12-05 13:39

    Make sure you imported @Test from the correct package.

    • Correct package: org.junit.Test
    • Incorrect pacakge: org.junit.jupiter.api.Test

    Please note that this is a solution for: If your @Before, @Atter, etc did not get called at all.

提交回复
热议问题