1

Does test class/file names have to end as "IT" in order for the lilberty:dev maven goal to work? When I followed Creating a RESTful web service and issued "mvn liberty:dev" command in the finish folder, once I changed the test file name EndpointIT.java to be EndpointTest and the class name EndpointIT EndpointTest(and nothing else), I saw test errors in the console when pressing ENTER.

If I changed file/class names to EndpointTestIT (with "IT" at the end), the test worked again.

It seems to me that a file and class must have "IT" suffix. Would this be a requirement a design feature? Or did I miss reading something?

John
  • 13
  • 2

1 Answers1

0

The IT suffix is a convention for Maven failsafe plugin, as discussed on Is the 'IT.java' filename Suffix (instead of 'Test.java') for JUnit Integration Tests a convention?:

All classes in the test directory that have the suffix IT are executed by this plugin in the integragion-test phase. (Tests with suffix Test are exectued by the Maven Surefire Plugin in the test phase.)

Additional information can be found in the Baeldung tutorial, Integration Testing with Maven.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Cheatr01
  • 51
  • 5