SlideShare uma empresa Scribd logo
1 de 25
Mysore MuleSoft Meetup
19-Dec-2023
Munits in Mule 4
[Deep-Dive]
Organizers
Shubham Chaurasia
Billennium India
Pro Integration Developer
Giridhar Meka
Sr. Technology Architect
/in/giridharmeka
/in/shubhamchaurasia1
Priya Shaw
LTI MindTree
Sr. Integration Specialist
/in/priya-shaw
• MuleSoft Developer at Hashedin by Deloitte.
• 5+ Years of Experience
• MuleSoft Certified Developer
Prithwish Karforma
Prithwish Karforma
Speaker
● Overview of Munits
 What is Munit and how does it help
● Overview of Code Coverage
 What is code coverage and its implications
● Parameterizing Munits
 Benefits and use cases
● Special cases of Munits
 Choice Router
 For Each Scope
 APIKIT
● Hands-On
 Each of the special cases mentioned
● Q&A
● Wrap-Up
Agenda
Overview of Munits
What is Munit
MUnit is a Mule application testing framework that allows us to easily build automated tests
for our integrations and APIs.
It provides a full suite of integration and unit test capabilities, and is fully integrated with
Maven for integration with continuous deployment environment.
Each test is divided in to 3 scopes –
 Behaviour - The behaviour scope sets all the preconditions before executing the test logic.
 Execution - The execution scope contains the testing logic which waits for all processes to finish before
executing the next scope.
 Validation - The validation scope contains all the validations for the results of the execution scope.
What is Munit
Overview of Code Coverage
What is Code Coverage
Code coverage is a white-box testing technique performed to verify the extent to which the code
has been executed.
Why perform Code Coverage?
Code coverage is primarily performed at the unit testing level. Unit tests are created by developers,
thus giving them the best vantage from which to decide what tests to include in unit testing.
A high percentage of code coverage results in lower chances of unidentified bugs. It is best to set
a minimum rate of code coverage that must be achieved before testing in production to reduce the
chances of bugs being detected later in development.
Code coverage answers several questions, such as:
● Are there enough tests in the unit test suite?
● Do more tests need to be added?
Parameterizing Munits
For complicated scenarios, it is often necessary to parameterize the event properties.
A parameterized test suite runs the same tests but with different inputs.
YAML-file based parameterising:
The test runs 4 times, each time with a different set of input-output pair, first with “aus”, then “nz”, then
“in” and finally “def” for default case.
We must save our parameterizations values in a YAML file in the /test/resources directory of our Mule
application project
Parameterizing Munits
Munit Configuration based:
In this case, the test runs twice with different input/output pairs each for choice and loop
scopes.
Parameterizing Munits
Munits – Special Cases
Choice Router – YAML
Use case:
Choice Router – YAML
Choice Router – Config
Use case:
Choice Router – Config
For Each Scope
Use case:
For Each Scope
APIKIT Router – Happy Path
Use case:
APIKIT Router – Happy Path
Hands-On
Special Cases
Networking time
Thank You

Mais conteúdo relacionado

Semelhante a Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40

Hybrid framework for test automation
Hybrid framework for test automationHybrid framework for test automation
Hybrid framework for test automation
srivinayak
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
Quontra Solutions
 

Semelhante a Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40 (20)

Hybrid framework for test automation
Hybrid framework for test automationHybrid framework for test automation
Hybrid framework for test automation
 
Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17
 
5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit Tests5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit Tests
 
Testing strategies and best practices using MUnit
Testing strategies and best practices using MUnitTesting strategies and best practices using MUnit
Testing strategies and best practices using MUnit
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
 
Unit Testing Software Market Size, Share.pdf
Unit Testing Software Market Size, Share.pdfUnit Testing Software Market Size, Share.pdf
Unit Testing Software Market Size, Share.pdf
 
Accelerating tests with Cypress for a leaderboard platform
Accelerating tests with Cypress for a leaderboard platformAccelerating tests with Cypress for a leaderboard platform
Accelerating tests with Cypress for a leaderboard platform
 
Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)Automation Testing of Web based Application with Selenium and HP UFT (QTP)
Automation Testing of Web based Application with Selenium and HP UFT (QTP)
 
Automation Best Practices.pptx
Automation Best Practices.pptxAutomation Best Practices.pptx
Automation Best Practices.pptx
 
Chapter 5 - Tools
Chapter 5 - ToolsChapter 5 - Tools
Chapter 5 - Tools
 
MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020
 
MuleSoft Meetup Charlotte 2019 - Dec 10
MuleSoft Meetup Charlotte  2019 - Dec 10MuleSoft Meetup Charlotte  2019 - Dec 10
MuleSoft Meetup Charlotte 2019 - Dec 10
 
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderToronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
 
Designing for Testability: Differentiator in a Competitive Market
Designing for Testability: Differentiator in a Competitive MarketDesigning for Testability: Differentiator in a Competitive Market
Designing for Testability: Differentiator in a Competitive Market
 
MuleSoft Surat Virtual Meetup#31 - Async API, Process Error, Circuit Breaker ...
MuleSoft Surat Virtual Meetup#31 - Async API, Process Error, Circuit Breaker ...MuleSoft Surat Virtual Meetup#31 - Async API, Process Error, Circuit Breaker ...
MuleSoft Surat Virtual Meetup#31 - Async API, Process Error, Circuit Breaker ...
 
10-Testing-system.pdf
10-Testing-system.pdf10-Testing-system.pdf
10-Testing-system.pdf
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Unit Testing vs End-To-End Testing_ Understanding Key Differences.pdf
Unit Testing vs End-To-End Testing_ Understanding Key Differences.pdfUnit Testing vs End-To-End Testing_ Understanding Key Differences.pdf
Unit Testing vs End-To-End Testing_ Understanding Key Differences.pdf
 
Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.
 
Ch 2 Apraoaches Of Software Testing
Ch 2 Apraoaches Of Software Testing Ch 2 Apraoaches Of Software Testing
Ch 2 Apraoaches Of Software Testing
 

Mais de MysoreMuleSoftMeetup

MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
MysoreMuleSoftMeetup
 

Mais de MysoreMuleSoftMeetup (20)

Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
MuleSoft Integration with AWS Lambda [Serverless Function] | MuleSoft Mysore ...
 
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
Unlocking Seamless End-to-End Automation with the MuleSoft Automation Suite |...
 
State Management in Mule applications | MuleSoft Mysore Meetup #42
State Management in Mule applications |  MuleSoft Mysore Meetup #42State Management in Mule applications |  MuleSoft Mysore Meetup #42
State Management in Mule applications | MuleSoft Mysore Meetup #42
 
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41Anypoint Code Builder (ACB) + AI + Hands-On |  MuleSoft Mysore Meetup #41
Anypoint Code Builder (ACB) + AI + Hands-On | MuleSoft Mysore Meetup #41
 
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39Transaction Management in Mule 4 |  MuleSoft Mysore Meetup #39
Transaction Management in Mule 4 | MuleSoft Mysore Meetup #39
 
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
Exploring the realms of MuleSoft RPA | MuleSoft Mysore Meetup #38
 
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
 
Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
 
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
Mastering the Puzzle Integration Patterns Decoded | MuleSoft Mysore Meetup #35
 
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
Discovering Seamless Integration: MuleSoft, AWS and Snowflake | MuleSoft Myso...
 
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
Application Design Thinking wrt Integration Architecture - Part II | MuleSoft...
 
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
HL7 Integration using Mulesoft | MuleSoft Mysore Meetp #32
 
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
Application Design Thinking wrt Integration Architecture - Part I | MuleSoft ...
 
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
Slack and ChatGPT Integration using MuleSoft | MuleSoft Mysore Meetup #30
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
 
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
MuleSoft Integration with ChatGPT — Part 1 | MuleSoft Mysore Meetup #27
 
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
 
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
 

Último

Último (20)

MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
Mattingly "AI and Prompt Design: LLMs with Text Classification and Open Source"
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 

Munits in Mule 4 [Deep-Dive] | MuleSoft Mysore Meetup #40

  • 1.
  • 3. Organizers Shubham Chaurasia Billennium India Pro Integration Developer Giridhar Meka Sr. Technology Architect /in/giridharmeka /in/shubhamchaurasia1 Priya Shaw LTI MindTree Sr. Integration Specialist /in/priya-shaw
  • 4. • MuleSoft Developer at Hashedin by Deloitte. • 5+ Years of Experience • MuleSoft Certified Developer Prithwish Karforma Prithwish Karforma Speaker
  • 5. ● Overview of Munits  What is Munit and how does it help ● Overview of Code Coverage  What is code coverage and its implications ● Parameterizing Munits  Benefits and use cases ● Special cases of Munits  Choice Router  For Each Scope  APIKIT ● Hands-On  Each of the special cases mentioned ● Q&A ● Wrap-Up Agenda
  • 7. What is Munit MUnit is a Mule application testing framework that allows us to easily build automated tests for our integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully integrated with Maven for integration with continuous deployment environment. Each test is divided in to 3 scopes –  Behaviour - The behaviour scope sets all the preconditions before executing the test logic.  Execution - The execution scope contains the testing logic which waits for all processes to finish before executing the next scope.  Validation - The validation scope contains all the validations for the results of the execution scope.
  • 9. Overview of Code Coverage
  • 10. What is Code Coverage Code coverage is a white-box testing technique performed to verify the extent to which the code has been executed. Why perform Code Coverage? Code coverage is primarily performed at the unit testing level. Unit tests are created by developers, thus giving them the best vantage from which to decide what tests to include in unit testing. A high percentage of code coverage results in lower chances of unidentified bugs. It is best to set a minimum rate of code coverage that must be achieved before testing in production to reduce the chances of bugs being detected later in development. Code coverage answers several questions, such as: ● Are there enough tests in the unit test suite? ● Do more tests need to be added?
  • 12. For complicated scenarios, it is often necessary to parameterize the event properties. A parameterized test suite runs the same tests but with different inputs. YAML-file based parameterising: The test runs 4 times, each time with a different set of input-output pair, first with “aus”, then “nz”, then “in” and finally “def” for default case. We must save our parameterizations values in a YAML file in the /test/resources directory of our Mule application project Parameterizing Munits
  • 13. Munit Configuration based: In this case, the test runs twice with different input/output pairs each for choice and loop scopes. Parameterizing Munits
  • 15. Choice Router – YAML Use case:
  • 17. Choice Router – Config Use case:
  • 21. APIKIT Router – Happy Path Use case:
  • 22. APIKIT Router – Happy Path