SlideShare uma empresa 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

Mais conteúdo relacionado

Semelhante 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
 

Semelhante 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
 

Mais 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
 

Mais 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

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

#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?