【发布时间】:2018-01-30 20:04:40
【问题描述】:
我需要在 M-unit 中的 set message 组件中填充它,因为现在我可以使用配置加载属性文件。
<spring:beans>
<spring:bean id="appProps"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<spring:property name="singleton" value="true" />
<spring:property name="location" value="classpath:input.properties" />
</spring:bean>
</spring:beans>
但是当我尝试从文件中动态加载键和值时,值部分被解析为实际值而不是键
<munit:invocation-property
key="#[groovy:appProps.get('flowVars.name.one')]" value="#[groovy:appProps.get('flowVars.name.one.value')]" />
有人能帮我解释一下为什么表达式没有在属性键中得到解析吗?
【问题讨论】:
-
属性文件内容:
#*******invocation properties*******# flowVars.name.one=testVar flowVars.name.one.value=one flowVars.two.name=testVar2 flowVars.two.value=2 -
问题。为什么在属性文件中使用 MEL
#和 flowVars 命名约定?如果您使用属性文件定义为键值对并使用$根据您的逻辑动态获取值。QUestion 是关于 Munit 设置消息组件并发布反映munit:invocation-propertyno 这样的组件。