I have an integration tests class extended from AbstractTestNGSpringContextTests. I want to run test class twice, each time with a different profile programmatically and not by hard-coding profile and configuration xml as below.
@ContextConfiguration(locations = { "classpath:MyBatisBeanConfiguration.xml" })
@ActiveProfiles("cloud")
public class MyIntegrationTests extends AbstractTestNGSpringContextTests
{
@Test
public void myTest()
{
//do something
}
}