According to this answer, the @Before
annotation is executed once before each test, whereas the @BeforeClass
annotation is only executed once before all tests.
My intuition tells me to always use @BeforeClass
, so the question is, why even use @Before
? Is there a case where the @Before
annotation performs better/faster than the @BeforeClass
annotation?