In my Java code , I have below 3 methods .When I ran the pom.xml Run as Maven Install , only the @Test method get picked .
@Parameters("year")
@Test (groups = {"smoke"})
public void newUserAuthenticationTest(String year){
System.out.println("Sniff-"+year);
}
@Parameters("year")
@BeforeClass (groups = {"smoke"})
public void beforeMe(String year){
System.out.println("Before -"+year);
}
@Parameters("year")
@AfterSuite (groups = {"smoke"})
public void afterMe(String year){
System.out.println("After -"+year);
}
Is there a way to include annotations other than @Test when running via maven-surefire-plugin?
I wish to have @AfterSuite ,@BeforeClass
Here is my maven-surefire-plugin configuration .
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<systemPropertyVariables>
<year>2020</year>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>TestPlanLoc/FirstTestPlan.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>