SlideShare una empresa de Scribd logo
1 de 24
03rd June 2023
Calicut MuleSoft Meetup Group
#9 MUnit in Mule 4
Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
2
A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
3
Organizers
Fathima Farzana
NJC Labs
MuleSoft / Integration Developer
John Mathew Philip
NJC Labs
MuleSoft / Integration Developer
Anoop Ramachandran
NJC Labs
Technical Instructor / Integration Architect
https://www.linkedin.com/feed/update/urn:li:activity:7069907733281406977/
✔ MuleSoft Ambassador
✔ MuleSoft Meetup Speaker
✔ Guwahati & Lucknow Meetup Leader
✔ Certified MuleSoft Developer & Architect
✔ Total 8 years of experience (6 in MuleSoft)
✔ Working as Associate Solution Architect at Apisero Inc.
Abhishek Bathwal
Apisero Inc
Associate Solution Architect
● About the Speaker
Introduction
linkedin.com/in/abhishek-bathwal-
49360694
youtube.com/@abhishekbathwal1805
youtube.com/@developersguide5562 6
7
Agenda
Introduction To
Munit
Different
Approach of
Writing Munit
Limitations of
Test Recorder
Munit Tools and
Components
Executing Munit
Suits
Munit Coverage
Live
Demonstration
What is Munit?
9
MUnit is Anypoint Platform’s dedicated unit testing tool specifically designed for Mule applications. It
runs inside a Mule runtime, manually in Anypoint Studio, and automatically as part of the Maven-based
CI/CD build process. MUnit is designed to create structural test cases as Mule flows. That means you
can use components on top of MUnit and MUnit tool modules.
What is Munit?
10
Different Approach of Writing Munit
● Munit Test Recorder
● Manually
11
Limitations with Test Recorder
The test recorder is limited in the following ways when you create MUnit tests:
● You cannot create tests for flows with Mule errors raised inside the flow or already
existing in the incoming event, not even if they are handled by an on error continue error
handler.
● A recorded flow execution ends successfully, but the result does not reach its
destination because the application is killed.
● Your validations fail every time your test runs if you configure Spy or Assert processors
to assert values for random data, time-dependent information (such as timestamps), or
values resulting from parallel processes, because those values change in every
execution.
● Mocking values resulting from parallel processes causes a mixture of real and mocked
data that compromises the execution of the processors that follow in your test.
● Although the recorder supports data iteration in the flow, such as recursivity or loops, it
does not support cases in which the structure of the data being tested changes inside
the iteration.
● The recorder does not support mocking a message before or inside a Foreach
12
● Test
● Mock When
● Set Event
● Asset That
● Assert Equal
● Asset Expression
● Verify Call
● Spy
Munit Tools and Components
13
Executing Munit Suite
● From Studio
● From cmd (mvn clean test)
14
Munit Coverage
The MUnit Coverage feature provides a measurement of how much of a Mule application has been
executed by a set of MUnit tests by counting the amount of event processors executed.This allows
you to obtain a quality standard for your application, and provides metrics for:
● Application overall coverage: An average of the items below.
● Resource coverage: Refers to each Mule configuration file under src/main/mule.
● Flow coverage: Refers to any of the following components: Flows, Sub-flows, and Batch jobs.
15
● <ignoreFlows>
<ignoreFlow>FlowName</ignoreFlow>
</ignoreFlows>
● <ignoreFiles>
<ignoreFile>FileNamet.xml</ignoreFile>
</ignoreFiles>
Ignoring Files or Flow
Munit for Batch
Processing
Batch Processing
Mule batch processing components are designed for reliable, asynchronous processing of larger-than-
memory data sets. The components are the Batch Job, Batch Step, and Batch Aggregator. The Batch
Job component automatically splits source data and stores it into persistent queues, which makes it
possible to process large data sets while providing reliability. In the event that the application is re-
deployed or Mule crashes, the job execution is able to resume at the point it stopped.
17
Phases:
● Load and Dispatch
● Process
● On Complete
MUnit for Batch
18
Demo
20
● https://docs.mulesoft.com/mule-runtime/3.6/munit
● https://docs.mulesoft.com/munit/2.3/test-recorder
● https://blogs.mulesoft.com/dev-guides/how-to-tutorials/munit-testing-strategies/
● https://dzone.com/articles/mock-apikitrouter-and-write-munit-test-cases-for-d
● https://youtu.be/iLTqZ_ZcdEs
● https://docs.mulesoft.com/mule-runtime/4.4/batch-processing-concept
● https://javastreets.com/blog/2017/9/mule-batch-processing-part1-introduction.html
● https://billennium.com/blog/munit-for-batch-module-in-mule-4/
Reference
Q&A
Take a stand !
22
●Nominate yourself for the next meetup speaker and suggest a topic as well.
23
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/calicut/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?
Thank You

Más contenido relacionado

Similar a #9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx

MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneMuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneIntegralZone
 
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
MuleSoft Kochi Meetup #5– Handling Mule ExceptionsMuleSoft Kochi Meetup #5– Handling Mule Exceptions
MuleSoft Kochi Meetup #5– Handling Mule Exceptionssumitahuja94
 
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 MUnitJimmy Attia
 
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-MonitoringPrinceton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-MonitoringSravan Lingam
 
Vancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVikalp Bhalia
 
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 RecorderAlexandra N. Martinez
 
Mule soft meetup_th_no1
Mule soft meetup_th_no1Mule soft meetup_th_no1
Mule soft meetup_th_no1WendyTey4
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XAmit Singh
 
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
MuleSoft Surat Meetup#47 - Error Handling With MuleSoftMuleSoft Surat Meetup#47 - Error Handling With MuleSoft
MuleSoft Surat Meetup#47 - Error Handling With MuleSoftJitendra Bafna
 
Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17WendyTey4
 
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On Premise
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On PremiseMuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On Premise
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On PremiseJitendra Bafna
 
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoftMuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoftJitendra Bafna
 
27th Hyderabad MuleSoft Meetup
27th Hyderabad MuleSoft Meetup27th Hyderabad MuleSoft Meetup
27th Hyderabad MuleSoft MeetupMuleSoft Meetups
 
MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020Julian Douch
 
Sydney mule soft meetup 30 april 2020
Sydney mule soft meetup   30 april 2020Sydney mule soft meetup   30 april 2020
Sydney mule soft meetup 30 april 2020Royston Lobo
 
Melbourne Virtual MuleSoft Meetup October 2021
Melbourne Virtual MuleSoft Meetup October 2021Melbourne Virtual MuleSoft Meetup October 2021
Melbourne Virtual MuleSoft Meetup October 2021Daniel Soffner
 
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63Angel Alberici
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021Nicholas Bowman
 

Similar a #9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx (20)

MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral ZoneMuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
MuleSoft Meetup | Reading Meetup Group | Hosted by Integral Zone
 
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
MuleSoft Kochi Meetup #5– Handling Mule ExceptionsMuleSoft Kochi Meetup #5– Handling Mule Exceptions
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
 
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
 
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-MonitoringPrinceton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
 
Vancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-julyVancouver mulesoft meetup_23-july
Vancouver mulesoft meetup_23-july
 
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
 
Mule soft meetup_th_no1
Mule soft meetup_th_no1Mule soft meetup_th_no1
Mule soft meetup_th_no1
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
 
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
MuleSoft Surat Meetup#47 - Error Handling With MuleSoftMuleSoft Surat Meetup#47 - Error Handling With MuleSoft
MuleSoft Surat Meetup#47 - Error Handling With MuleSoft
 
Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17Mule soft meetup_tw_no1_june17
Mule soft meetup_tw_no1_june17
 
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On Premise
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On PremiseMuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On Premise
MuleSoft Surat Virtual Meetup#37 - Anypoint Monitoring On Premise
 
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoftMuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
MuleSoft Surat Meetup#40 - Watermarking Concept and Fragments in MuleSoft
 
27th Hyderabad MuleSoft Meetup
27th Hyderabad MuleSoft Meetup27th Hyderabad MuleSoft Meetup
27th Hyderabad MuleSoft Meetup
 
API LifeCycle Management
API LifeCycle ManagementAPI LifeCycle Management
API LifeCycle Management
 
Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
 
MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020MuleSoft Singapore Meetup May 2020
MuleSoft Singapore Meetup May 2020
 
Sydney mule soft meetup 30 april 2020
Sydney mule soft meetup   30 april 2020Sydney mule soft meetup   30 april 2020
Sydney mule soft meetup 30 april 2020
 
Melbourne Virtual MuleSoft Meetup October 2021
Melbourne Virtual MuleSoft Meetup October 2021Melbourne Virtual MuleSoft Meetup October 2021
Melbourne Virtual MuleSoft Meetup October 2021
 
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
 
MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021MuleSoft Meetup Adelaide 7th April 2021
MuleSoft Meetup Adelaide 7th April 2021
 

Más de JohnMathewPhilip

#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule #6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule JohnMathewPhilip
 
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatformJohnMathewPhilip
 
#4 Calicut MuleSoft Meetup - Message Resequencing in Mule
#4 Calicut MuleSoft Meetup - Message Resequencing in Mule#4 Calicut MuleSoft Meetup - Message Resequencing in Mule
#4 Calicut MuleSoft Meetup - Message Resequencing in MuleJohnMathewPhilip
 
#3 calicut meetup - understanding slb, dlb and web sockets
#3   calicut meetup - understanding slb, dlb and web sockets#3   calicut meetup - understanding slb, dlb and web sockets
#3 calicut meetup - understanding slb, dlb and web socketsJohnMathewPhilip
 
#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_july#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_julyJohnMathewPhilip
 
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoftJohnMathewPhilip
 

Más de JohnMathewPhilip (6)

#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule #6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
#6 Calicut MuleSoft Meetup : Demystyfying Custom Policies in Mule
 
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform
#5-Calicut-MuleSoft-Meetup-User-Management-in-AnypointPlatform
 
#4 Calicut MuleSoft Meetup - Message Resequencing in Mule
#4 Calicut MuleSoft Meetup - Message Resequencing in Mule#4 Calicut MuleSoft Meetup - Message Resequencing in Mule
#4 Calicut MuleSoft Meetup - Message Resequencing in Mule
 
#3 calicut meetup - understanding slb, dlb and web sockets
#3   calicut meetup - understanding slb, dlb and web sockets#3   calicut meetup - understanding slb, dlb and web sockets
#3 calicut meetup - understanding slb, dlb and web sockets
 
#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_july#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_july
 
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
 

Último

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

#9 Calicut MuleSoft Meetup - Munits in Mule 4.pptx

  • 1. 03rd June 2023 Calicut MuleSoft Meetup Group #9 MUnit in Mule 4
  • 2. Safe Harbour Statement ● Both the speaker and the host are organizing this meet-up in individual capacity only. We are not representing our companies here. ● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any responsibility that same solution will work for your business requirements. ● This presentation is not meant for any promotional activities. 2
  • 3. A recording of this meetup will be uploaded to events page within 24 hours. Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab. Make it more Interactive!!! Give us feedback! Rate this meetup session by filling feedback form at the end of the day. We Love Feedbacks!!! Its Bread & Butter for Meetup. Housekeeping 3
  • 4. Organizers Fathima Farzana NJC Labs MuleSoft / Integration Developer John Mathew Philip NJC Labs MuleSoft / Integration Developer Anoop Ramachandran NJC Labs Technical Instructor / Integration Architect
  • 6. ✔ MuleSoft Ambassador ✔ MuleSoft Meetup Speaker ✔ Guwahati & Lucknow Meetup Leader ✔ Certified MuleSoft Developer & Architect ✔ Total 8 years of experience (6 in MuleSoft) ✔ Working as Associate Solution Architect at Apisero Inc. Abhishek Bathwal Apisero Inc Associate Solution Architect ● About the Speaker Introduction linkedin.com/in/abhishek-bathwal- 49360694 youtube.com/@abhishekbathwal1805 youtube.com/@developersguide5562 6
  • 7. 7 Agenda Introduction To Munit Different Approach of Writing Munit Limitations of Test Recorder Munit Tools and Components Executing Munit Suits Munit Coverage Live Demonstration
  • 9. 9 MUnit is Anypoint Platform’s dedicated unit testing tool specifically designed for Mule applications. It runs inside a Mule runtime, manually in Anypoint Studio, and automatically as part of the Maven-based CI/CD build process. MUnit is designed to create structural test cases as Mule flows. That means you can use components on top of MUnit and MUnit tool modules. What is Munit?
  • 10. 10 Different Approach of Writing Munit ● Munit Test Recorder ● Manually
  • 11. 11 Limitations with Test Recorder The test recorder is limited in the following ways when you create MUnit tests: ● You cannot create tests for flows with Mule errors raised inside the flow or already existing in the incoming event, not even if they are handled by an on error continue error handler. ● A recorded flow execution ends successfully, but the result does not reach its destination because the application is killed. ● Your validations fail every time your test runs if you configure Spy or Assert processors to assert values for random data, time-dependent information (such as timestamps), or values resulting from parallel processes, because those values change in every execution. ● Mocking values resulting from parallel processes causes a mixture of real and mocked data that compromises the execution of the processors that follow in your test. ● Although the recorder supports data iteration in the flow, such as recursivity or loops, it does not support cases in which the structure of the data being tested changes inside the iteration. ● The recorder does not support mocking a message before or inside a Foreach
  • 12. 12 ● Test ● Mock When ● Set Event ● Asset That ● Assert Equal ● Asset Expression ● Verify Call ● Spy Munit Tools and Components
  • 13. 13 Executing Munit Suite ● From Studio ● From cmd (mvn clean test)
  • 14. 14 Munit Coverage The MUnit Coverage feature provides a measurement of how much of a Mule application has been executed by a set of MUnit tests by counting the amount of event processors executed.This allows you to obtain a quality standard for your application, and provides metrics for: ● Application overall coverage: An average of the items below. ● Resource coverage: Refers to each Mule configuration file under src/main/mule. ● Flow coverage: Refers to any of the following components: Flows, Sub-flows, and Batch jobs.
  • 17. Batch Processing Mule batch processing components are designed for reliable, asynchronous processing of larger-than- memory data sets. The components are the Batch Job, Batch Step, and Batch Aggregator. The Batch Job component automatically splits source data and stores it into persistent queues, which makes it possible to process large data sets while providing reliability. In the event that the application is re- deployed or Mule crashes, the job execution is able to resume at the point it stopped. 17 Phases: ● Load and Dispatch ● Process ● On Complete
  • 19. Demo
  • 20. 20 ● https://docs.mulesoft.com/mule-runtime/3.6/munit ● https://docs.mulesoft.com/munit/2.3/test-recorder ● https://blogs.mulesoft.com/dev-guides/how-to-tutorials/munit-testing-strategies/ ● https://dzone.com/articles/mock-apikitrouter-and-write-munit-test-cases-for-d ● https://youtu.be/iLTqZ_ZcdEs ● https://docs.mulesoft.com/mule-runtime/4.4/batch-processing-concept ● https://javastreets.com/blog/2017/9/mule-batch-processing-part1-introduction.html ● https://billennium.com/blog/munit-for-batch-module-in-mule-4/ Reference
  • 21. Q&A
  • 22. Take a stand ! 22 ●Nominate yourself for the next meetup speaker and suggest a topic as well.
  • 23. 23 ● Share: ○ Tweet using the hashtag #MuleSoftMeetups ○ Invite your network to join: https://meetups.mulesoft.com/calicut/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program What’s next?