0

I have created simple Test Suit for Test_flow but when I try to run that flow I am getting error.

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)

Steps I Performed:

  1. Using Munit Test Suit wizard created basic test suit for Test_flow and sub flows
  2. Not added anything in that test suit (i.e. mocks , variable, assert conditions)
  3. Run the basic test suit and every timing I am getting that error

I am using Anypoint studio 6.2 EE version with 3.8.3 mule runtime.

Pramod Raut
  • 677
  • 3
  • 9
  • 22

3 Answers3

3

Did you import your XML configuration files in your test suite?

Example:

<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>
JoostD
  • 734
  • 6
  • 13
  • 1
    Please notice he means: "make sure that you're importing the file containing the bean named ServiceNowREST__Default_Configuration" MUnit will only import the file containing they flow if you do right click or those selected if you use the wizard. It doesn't know how to introspect the app to import all those necessary resources which my lead to this kind of issues. – Dds Nov 15 '17 at 14:42
1

From your exception, it states that "No bean named 'ServiceNowREST__Default_Configuration' is defined". Please check whether the mule configuration file which has the "ServiceNowREST__Default_Configuration" defined is present in the classpath of the test suite. Adding the file to classpath will resolve the issue

Alagappan
  • 66
  • 2
0

Can't reproduce it. Do you have a Maven project or a plain Mule project? Would be nice if you could add some additional informations about your project.