首页 > 解决方案 > 如何为多个系统属性执行多个逻辑端?

问题描述

我正在尝试检查是否存在多个系统属性EnabledIf

当我做一个单一的系统属性时,它似乎工作。

@EnabledIf(expression = "#{systemProperties['some'] != null}")

但我因多个系统属性而失败。

@EnabledIf(expression = "#{systemProperties['some'] != null} and " +
                        "#{systemProperties['other'] != null}")

我怎样才能做到这一点?

标签: spring-eljunit-jupiter

解决方案


and需要在表达式内:

@EnabledIf("#{systemProperties['some'] != null and "
           + "systemProperties['other'] != null}")

推荐阅读