Questions tagged [munit]

MUnit is a Mule application testing framework that allows you to easily build automated tests for your integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully integrated with Maven and Surefire for integration with your continuous deployment environment.

It allows mule developers to automate mule app testing in an easy manner.

151 questions
1
vote
1 answer

Mule Munit with Choice followed by Dataweave transform

I have a flow that has a Choice followed by a Dataweave transform. Input to the flow is json. The choice has this when statement: The flow works well:
jd76fid
  • 11
  • 3
1
vote
1 answer

How to ignore whitespace in xml comparison in MUnit

When doing an MUnit test to check a dataweave output I am comparing the payload to a file which has been read using the getResource() method.
a.cayzer
  • 289
  • 4
  • 22
1
vote
1 answer

Mocked Amazon S3 Mule connector still invokes actual S3 action

We are trying to mock the Amazon S3 connector in an MUNIT suite. We have already tried multiple approaches, but the mock never seems to work: For a S3 connector added in single flow, we tried creating a mocked payload response. But the final output…
gsonal
  • 11
  • 1
  • 6
1
vote
1 answer

How to write a test case for negative scenario(exception scenario) in munit..?

There is flow which is going to call http-outbound endpoint. I want to write test case for the scenario if http is not available(catching the exception in flow and working as expected from POSTMAN). I tried using throw an exception for mocking the…
1
vote
1 answer

Munit maven error

I am getting an error while trying to run Munit using Maven. It's a domain project and my Munit test cases are available in mule projects. when I ran maven, it is giving me file not found exception (mule-domain-config.xml). I tried all possible ways…
1
vote
2 answers

MUnit tests cause maven build to fail

I have a Maven-ized Anypoint Studio project that fails a Maven build upon executing mvn clean package; however, running mvn clean package -DskipMunitTestsresults in a successful build. Stack Trace: [INFO]…
zachcdr
  • 31
  • 1
  • 4
1
vote
3 answers

Set HTTP Url Parameters for MUnit Mule Test

I have a flow I wish to test. The flow has an HTTP inbound connector, and the flow itself acts as a RESTful service. The flow expects a few URL parameters to be set, and accesses these throughout using the standard notation:…
Developer102938
  • 61
  • 1
  • 14
1
vote
2 answers

MUnit error : A JNI error has occurred, please check your installation and try again

I follow tutorial to install MUnit plugin as this page: https://docs.mulesoft.com/munit/v/1.1.1/using-munit-in-anypoint-studio But, when I run an empty test case, AnyPoint return me an error as: A JNI error has occurred, please check your…
1
vote
1 answer

Does anyone know how to turn off MUnit Coverage analysis?

After my mock testing is complete and successful, the Maven plugin starts this: [org.mule.munit.remote.CoverageManager]Calculating application coverage for resources:app-config.xml I removed the configuration in my POM where coverage was set to…
David Whitehurst
  • 352
  • 4
  • 21
1
vote
1 answer

Test a Batch Flow in MUnit

I am trying to test a batch flow but if I place a reference to a batch flow in my MUnit test, the test will finish instantly and run the asserts, while the batch flow continues in the background. Is there a way to force my batch job to run…
CamJohnson26
  • 1,119
  • 1
  • 15
  • 40
1
vote
1 answer

Specifying Mule Message Collection as payload in MUnit Mock Processor

In MUnit Mock Message Processor how do we specify a non specific payload such as Mule Message Collection (comma separated XML data) in the return with message payload field. In general if we just hard code the value, it would be taken as a string…
1
vote
2 answers

load properties in mule munit

I have some placeholders in my flow. Values for these placeholders are specified in a properties file (in classpath). I am doing munit using java. Currently, these placeholders are not getting replaced by values in property file. Any idea how do I…
Renjith
  • 1,122
  • 1
  • 19
  • 45
1
vote
1 answer

How to write negative test cases in Munit

I am writing a negative test case where in I have to create an exception in flow. I want Global exception strategy to catch it, so that I can assert the response. Inside GlobalExceptionStrategy, we are setting some error code based on the exception…
Renjith
  • 1,122
  • 1
  • 19
  • 45
1
vote
4 answers

Exclude sub-flow with MUnit

Is there a way for me with MUnit to end the test and add the asserts when the sub-flow is called? I would like to split the tests up into smaller parts.
Jarle Hansen
  • 1,993
  • 2
  • 16
  • 29
1
vote
2 answers

Mule MUnit test with Maven, mule.home property is not defined

In our Mule projects we have a common properties file that is referenced from a number of Mule projects. To do this we put the file in the Mule installation directory and reference it in a flow in each project:
Sean
  • 1,416
  • 19
  • 51
1 2
3
10 11