JUnit — Annotations

Bijen Adhikari
2 min readAug 20, 2023
  1. @BeforeClass:- The first annotation is @BeforeClass. So, Now, this annotation is used to initialize any object that you are going to use in your test case or your running testes. @BeforeClass annotation specifies that method will be executed only once, before starting all the tests.
  2. @Before annotation specifies that method will be executed before each test.
  3. @Test annotation specifies that method is the test method.
  4. @After annotation will be executed every time after each test case. So, whatever you have initialized in @Before that should be…

--

--

Bijen Adhikari

Hi, I am Bijen from Nepal I write about Electronics, Electrical, Programming, Fitness. Also, I am a certified SSI Master Trainer.