如何排除 Spring 启动测试中的集成测试,根据外部属性进行 gradle?
尝试过@ActiveProfiles。但它没有奏效
这是我
找到的解决方案。
您可以根据外部系统属性排除这种情况。
-Dtest.profile=integration
和在build.gradle中
test {
if (System.properties['test.profile'] != 'integration') {
exclude '**/*integrationTests*'
}
}