我已经为通过APIKit路由器生成的流创建了Munit测试用例。但是在运行测试套件时,出现以下异常:
Exception in thread "main" java.lang.RuntimeException: org.mule.api.lifecycle.LifecycleException: null
at org.mule.munit.runner.mule.MunitSuiteRunner.<init>(MunitSuiteRunner.java:48)
at org.mule.munit.runner.remote.MunitRemoteRunner.run(MunitRemoteRunner.java:40)
at org.mule.munit.runner.remote.MunitRemoteRunner.main(MunitRemoteRunner.java:143)
Caused by: org.mule.api.lifecycle.LifecycleException: null
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:153)
at org.mule.construct.FlowConstructLifecycleManager.fireStartPhase(FlowConstructLifecycleManager.java:92)
at org.mule.construct.AbstractFlowConstruct.start(AbstractFlowConstruct.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237)
at org.mule.lifecycle.RegistryLifecycleManager$RegistryLifecycleCallback.onTransition(RegistryLifecycleManager.java:273)
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:152)
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:123)
at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:76)
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:136)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87)
at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69)
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:278)
at org.mule.munit.runner.MuleContextManager.startMule(MuleContextManager.java:68)
at org.mule.munit.runner.MuleContextManager.startMule(MuleContextManager.java:63)
at org.mule.munit.runner.mule.MunitSuiteRunner.<init>(MunitSuiteRunner.java:40)
谁能解决这个问题?提前致谢。
最佳答案
能否请您尝试将模拟连接器,模拟入站等属性添加到<munit:config doc:name="Munit configuration"/>
配置
下面是在munit配置xml文件中修改的munit:config标记。<munit:config doc:name="Munit configuration" mock-connectors="false" mock-inbounds="false"/>