I have added testNG to my pom file and created couple of tests.
@WebAppConfiguration
@ContextConfiguration(classes = {PersistenceConfig.class})
@Transactional
@TransactionConfiguration(defaultRollback = true)
public class TrackPersistenceServiceTest extends AbstractTransactionalTestNGSpringContextTests {
private static Logger logger = LoggerFactory.getLogger(TrackPersistenceServiceTest.class);
@Autowired
TrackPersistenceService trackPersistenceService;
// @Test(groups = {"dev"})
public void thatTracksListCanBeUpdated() throws Exception {
EntitiesCreatedEvent event = trackPersistenceService.updateTracksList();
assertTrue( event.getNumOfCreatedEntities()==12 );
}
When I am running the tests with debug mode using:
call mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=6666 -Xnoagent -Djava.compiler=NONE" test -Dgroups=dev
The surefire starts and is waiting on port 6666.
The problem: is that though I am connecting to it with intellij remote debugger. It executes the tests but the debugger does not stop at the breakpoints.
I am sure the breakpoints are on code that is being executed.
I added to pom:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
Didnt add the surefire plugin to the pom based on this tutorial
Any idea what I am missing?