It also makes sense to separate integration tests in the CI pipeline so that external outages don't block or break the build of the project. You should consider categorizing your tests by annotating them with @Category. You may create the interface especially for integration tests, for example, IntegrationTest:
public interface IntegrationTest { }
Then, you can mark your test with that interface using the @Category annotation:
@Category(IntegrationTest.class)public class OrderIntegrationTest { ... }
Finally, you can configure Maven to run only the selected type of tests, for example, with maven-failsafe-plugin:
<plugin> <artifactId>maven-failsafe-plugin</artifactId> <dependencies> <dependency> <groupId>org.apache.maven.surefire</groupId> ...