It is if you are using junit to run your tests. We use the annotations to create a unit test class and a separate steps class. The standard @Before stuff goes in the steps class, but the @BeforeClass annotation can be used in the main unit test class:
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"json", "<the report file"},
features = {"<the feature file>"},
strict = false,
glue = {"<package with steps classes"})
public class SomeTestIT {
@BeforeClass
public static void setUp(){
...
}
@AfterClass
public static void tearDown(){
...
}
}