java - 在Java,Spring Boot,gradle上进行集成测试以排除构建

标签 java gradle spring-boot-test

如何在基于外部属性的gradle上排除Spring Boot测试中的集成测试?

尝试使用@ActiveProfiles。但这没用

最佳答案

这是我找到的解决方案。

您可以基于外部系统属性来排除它。

-Dtest.profile=integration

并在build.gradle中
test {
    if (System.properties['test.profile'] != 'integration') {
    exclude '**/*integrationTests*'
   }
}

关于java - 在Java,Spring Boot,gradle上进行集成测试以排除构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47097414/

相关文章:

java - Finalize() 清理与垃圾收集器从内存中删除对象

java - 在Java中: Could not find the main class

java - Tomcat突然死了

intellij-idea - 如何在 IntelliJ IDEA 15 中的 gradle 项目上启用 Infinitest?

spring-boot - @JdbcTest 检测带有@SpringBootApplication 注释的类

Spring Boot测试最小测试片或者手动配置

java - java `indexOf`对 `float[]`的使用

Android Studio 和 Gradle,@NotNull 参数的参数 0

android - 停止Cordova CLI恢复build.gradle

spring - 无法加载 application.properties 文件 @DataJpaTest 注释