I have a method I call in my superclass like so:
public class superClass {
@Before
void createDriver(){
driverFactory = new FirefoxDriverFactory();
}
...
}
However, in my test suite specifically which inherits from the super class, I want it so that I can run my test with the @BeforeClass
annotation and not the @Before
annotation. I'm not sure, but is it possible to override the @Before
annotation or not? I tried the following:
public class derivedClass extends superClass{
@Override
@BeforeClass
void createDriver(){
driverFactory = new FirefoxDriverFactory();
}
}
But I get an error that says that the createDriver()
method must be static and I must remove the @Override
annotation. Is it possible to Override an annotation as opposed to a function? I was just wondering. Thanks!