264.24. 覆盖 Camel test kit 中的属性
从 Camel 2.10 开始提供
在通过 Camel 测试并使用 Properties 组件时,您可能希望提供直接从单元测试源代码中使用的属性。
现在,Camel 2.10 可以作为 Camel 测试套件,如 CamelTestSupport 类提供以下方法
-
useOverridePropertiesWithPropertiesComponent -
ignoreMissingLocationWithPropertiesComponent
例如,在您的单元测试类中,您可以覆盖 useOverridePropertiesWithPropertiesComponent 方法并返回 java.util.Properties,其中包含应该使用的属性。
264.24.1. 从单元测试源内提供属性 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
这可以从任何 Camel Test kits 完成,如 camel-test、camel-test-spring 和 camel-test-blueprint。
ignoreMissingLocationWithPropertiesComponent 可用于指示 Camel 忽略任何不可发现的位置,例如在运行单元测试时,在无法访问属性位置的环境中。