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
2 answers

MUnit test fails with Maven (Failed to invoke lifecycle phase "start")

We have a Mule flow with an associated MUnit test suite. The test runs fine when executed out of Anypoint Studio (right-click in the MUnit flow and select "Run MUnit Suite"). However with Maven with mvn test -X from the command line we get…
Sean
  • 1,416
  • 19
  • 51
1
vote
1 answer

How to configure H2 DB connection details in DB Server component for Munit Test case?

I need to test DB query without connecting to original database. I am trying to use Munit DB Server component to connect to H2 in memory DB instead of original database. I have configured sql script in DB Server config module`dbserver:config…
1
vote
1 answer

Mock a message from a 3rd party system in Mule using MUnit

I'm writing a test suite (using Munit) for a Mule application that is processing new data coming from an instance of Magento. One of my flows is polling Magento for new customers and the message it receives is of type:…
danw
  • 1,608
  • 4
  • 29
  • 48
1
vote
1 answer

Mule Munit FTP Server not accepting path value other than '/tmp'

I am writing Munit test cases for an application which has FTP/SFTP outbound endpoints. To mock these outbound endpoints and to run my test cases standalone, I am using Munit FTP server. But I am unable to give 'path' attribute value other than…
Kalyan
  • 99
  • 1
  • 16
1
vote
1 answer

Is there a way to mock non-global filters in a sub-flow using MUnit?

I wanted to know if there was a way to mock a custom-filter that is within a sub-flow using MUnit. I'm using Mule 3.4.0 and MUnit 3.4.0.M5. The sample flow looks like the following.
jcb
  • 195
  • 1
  • 4
  • 20
1
vote
1 answer

How to mock a Java component within Mule Flow using MUnit

I am trying to Unit test one of my sub-flows using MUnit, I need to mock out a custom Java component but I am unable to do so. My sub-flow reads as below
Sudarshan
  • 8,574
  • 11
  • 52
  • 74
0
votes
0 answers

Mock File Download in Mulesoft MUNIT test

How do you mock a file download in MUnit Tests? I have a REST API that downloads a zip file. When I am writing the munit test for the same, I used the Mock connector to mock the command using readURL(). This however gives me an error since the…
Andy
  • 51
  • 1
  • 8
0
votes
1 answer

Munit error while reading external DataWeave script into another file

I am setting up the structure for MUnit tests in our API and I am trying to do the following folder structure…
veejay
  • 81
  • 2
  • 12
0
votes
0 answers

Getting Invalid Key Store format error when running MUnit Tests in Jenkins

I am enabling SSL in my mulesoft application. I have added a keyStore in my application in http request connector. Everything works fine. Deployed to cloudhub by skipping Munits and tested. Everything works fine. Munit are running fine in local…
joono
  • 51
  • 6
0
votes
1 answer

Munit 2 - trying to test a simple GET endpoint by comparing response containing correlationId

Using Mule 4 and have a GET endpoint : getEmployee The API I am trying to MUNIT is an experience api and its expected response is : { "correlationId": correlationId ( Mule correlation id ), "empDetails" : { "ename": "John", …
0
votes
1 answer

MuleSoft - set payload contentLength from MUnit Set Event (multipart payload)

I have a Mule app which checks the payload's size using the contentLength metadata selector: payload.^contentLength <= 512 When I regularly send a request to the Mule app (using Postman / SoapUI), the app works correctly. However, when I use MUnit…
Bolchojeet
  • 455
  • 5
  • 14
0
votes
1 answer

Error in azure devops pipeline when Munits are not skipped for Mule4

Encountered below error in azure devops pipelines when Munits are included (i.e. we don't skip the Munits). ERROR 2022-06-15 08:37:49,325 [Embedded] org.mule.runtime.module.deployment.internal.DefaultArchiveDeployer: 2022-06-15T08:37:49.3334578Z…
0
votes
2 answers

Cannot make the Mock for the Salesforce Connectors work in the Munit Tests

I have been struggling with the Munit tests for the flows I created. The Flow have couple of Salesforce connectors to Query, Create. So in my Munit tests I have the Mocks added but it seems like I am missing something. The Flow is like…
user4912134
  • 1,003
  • 5
  • 18
  • 47
0
votes
1 answer

Mocking Multiple connectors in the flow

I have a flow where I have a connector to query and connector create record in Salesforce. I am a newbie to Mulesoft and the Munit tests. I just created a simple Munit tests for the flow with one connector to Salesforce. Just trying to do the same…
user4912134
  • 1,003
  • 5
  • 18
  • 47
0
votes
1 answer

Deploying to Cloudhub, Munit tests fails that has Salesforce create connector

I have a flow that has the Salesforce create connector, the Munit test that references the flow Runs fine locally. But when I try to deploy them to the CloudHub using the Azure Devops CI/CD pipeline throws error like WARN 2022-04-07 23:41:54,103…
user4912134
  • 1,003
  • 5
  • 18
  • 47