0

How to exclude integration tests on Spring Boot test, gradle based on external properties?

tried with @ActiveProfiles. But it did not work

shabinjo
  • 1,473
  • 1
  • 16
  • 22

1 Answers1

1

Here is the solution i found.

You can exclude this based on the external system properties.

-Dtest.profile=integration

and in build.gradle

test {
    if (System.properties['test.profile'] != 'integration') {
    exclude '**/*integrationTests*'
   }
}
shabinjo
  • 1,473
  • 1
  • 16
  • 22