0

我已经为 Test_flow 创建了简单的测试套件,但是当我尝试运行该流时,我遇到了错误。

java.lang.RuntimeException: org.mule.api.config.ConfigurationException: Error creating bean with name 'Test_flow': Cannot create inner bean '(inner bean)#6a12c7a8' of type [com.mulesoft.module.batch.BatchInputBlock] while setting bean property 'inputBlock'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6a12c7a8': Cannot create inner bean '(inner bean)#1d408060' of type [org.mule.config.spring.factories.PollingMessageSourceFactoryBean] while setting bean property 'messageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1d408060': Cannot create inner bean '(inner bean)#1a500561' of type [com.sungardas.osstools.modules.servicenowrest.generated.processors.SysHistorySetQueryAllValuesMessageProcessor] while setting bean property 'messageProcessor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1a500561': Cannot resolve reference to bean 'ServiceNowREST__Default_Configuration' while setting bean property 'moduleObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ServiceNowREST__Default_Configuration' is defined (org.mule.api.lifecycle.InitialisationException)

    at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:59)
    at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:45)
    at org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
    at org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
    at org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)

我执行的步骤:

  1. 使用 Munit 测试套件向导为 Test_flow 和子流创建基本测试套件
  2. 未在该测试套件中添加任何内容(即模拟、变量、断言条件)
  3. 运行基本的测试套装,每次我得到那个错误

我正在使用带有 3.8.3 mule 运行时的 Anypoint studio 6.2 EE 版本。

4

3 回答 3

3

您是否在测试套件中导入了 XML 配置文件?

例子:

<spring:beans>
    <spring:import resource="classpath:property-test-config.xml"/>
    <spring:import resource="classpath:mock-config-connectors.xml"/>
    <spring:import resource="classpath:contactUpdates-config.xml"/>
</spring:beans>
于 2017-02-02T09:02:48.763 回答
1

从您的异常中,它指出“没有定义名为 'ServiceNowREST__Default_Configuration' 的 bean”。请检查定义了“ServiceNowREST__Default_Configuration”的 mule 配置文件是否存在于测试套件的类路径中。将文件添加到类路径将解决问题

于 2017-02-14T02:15:29.087 回答
0

无法重现它。你有一个 Maven 项目还是一个普通的 Mule 项目?如果您可以添加一些有关您的项目的其他信息,那就太好了。

于 2017-02-02T08:20:02.163 回答