Apache camel 测试在使用 camel-archetype-blueprint 创建的项目中失败

Apache camel test fails in project created with camel-archetype-blueprint

我想为我的 camel 项目添加一些测试,所以我决定使用 maven 和 camel-archetype-blueprint 原型创建一个干净的项目来查看一些示例。

现在我使用以下方法创建了项目:

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-blueprint -DarchetypeVersion=2.15.3 -DgroupId=de.test - DartifactId=Testing

但如果不编辑任何内容,默认情况下测试会失败并出现此异常(使用 mvn 包构建它):

java.lang.RuntimeException: InputStream cannot be null

对于 运行 的那些测试,我还需要做些什么吗?

2.15.3 的 camel 蓝图测试依赖项中似乎存在错误。如果您将它更改为另一个版本(我试过 2.12.2 和 2.15.2),它会修复空输入流错误。

<!-- Testing & Camel Plugin -->
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-test-blueprint</artifactId>
  <version>2.15.2</version>
  <scope>test</scope>
</dependency>

我建议您尝试使用新发布的 2.15.4 版本,它似乎解决了您报告的问题。

查看 CAMEL-9142 报告(取自版本 2.15.4 发行说明)以获得更多信息:

Looks like update CAMEL-8948 dropped support for multiple blueprint descriptors within CamelBlueprintTestSupport file within camel-test-blueprint component. The symptom is a 'java.lang.RuntimeException: InputStream cannot be null' for unit tests that have a getBlueprintDescriptor with multiple file references, i.e. a '+' concatenating two or more descriptor files.