What is @before and BeforeClass?

What is @before and BeforeClass?

@before and BeforeClass are testing methods that run before every example in your test class, respectively. They can be used for setup and clean-up, like making sure a database is in a good state before each example runs. They can also be used for general initialization of variables and other things to improve the readability of your tests.