Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mule Munit Test cases are not working for APIKit router flows

I have created Munit test cases for the flows generated through APIKit router. But while running test suite, I got below exception:

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)

Can any one solve this problem? Thanks in advance.

like image 701
Ram Bavireddi Avatar asked Jan 08 '23 21:01

Ram Bavireddi


1 Answers

can you please try adding attributes like mock-connectors, mock-inbounds to

<munit:config doc:name="Munit configuration"/> configuration

below is modified munit:config tag in munit configuration xml file.

<munit:config doc:name="Munit configuration" mock-connectors="false" mock-inbounds="false"/>

like image 195
Mohan Avatar answered Mar 24 '23 20:03

Mohan