@BeforeClass

From NovaOrdis Knowledge Base
Revision as of 01:45, 29 August 2021 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

Internal

Overview

The annotation must be attached to a static method.

If two methods with different names are annotated with @BeforeClass in a test class hierarchy, as shown below:

TestBase.java
  │  @BeforeClass
  │  public static void methodA() {
  │     ...
  │  }
  │
  └── SomeTest.java
          @BeforeClass
          public static void methodB() {
            ...
          }