SlideShare a Scribd company logo
MUNIT MATCHERS
Shanky Gupta
OVERVIEW
MUnit matchers are a set of MEL functions that help in the creation of mocks
and validations (verifications/assertions). They enable you to define mocks,
verifications and assertions in terms of general values rather than specific
hardcoded values.
A matcher is a boolean function. In most of the MUnit matchers, this function
is a class type comparison. Its purpose is to validate if an argument belongs
to a certain class type.
A matcher does not receive parameters; rather, it’s a parameter itself.
isNull()
• Matches if the evaluated object is Null.
isNotNull()
• Matches if the evaluated object is not Null.
anyObject()
• Matches if the evaluated object is an Object.
anyBoolean()
• Matches if the evaluated object is a Boolean.
anyByte()
anyByteArray()
• Matches if the evaluated object is a Byte.
• Matches if the evaluated object is a ByteArray.
anyInt()
anyDouble()
• Matches if the evaluated object is a Double.
• Matches if the evaluated object is an Integer.
anyFloat()
anyShort()
• Matches if the evaluated object is a Short.
• Matches if the evaluated object is a Float.
anyString()
anyCollection()
• Matches if the evaluated object is a Collection.
• Matches if the evaluated object is a String.
anyList()
anySet()
anyMap()
• Matches if the evaluated object is a List.
• Matches if the evaluated object is a Set.
• Matches if the evaluated object is a Map.
…MATCHER FUNCTIONS CONTINUED
MUnit also offers some additional, rather specific, type of matchers. These
matchers evaluate thecontent of the parameter, not its type; even so, they do
not evaluate by specific values.
matchRegex(<regex>)
matchContains(<string_to_look_for>)
• Matches if the value of the attribute during the test run verifies the user-provided
regular expression
• Matches if the value of the attribute during the test run contains the specified user-
provided string.
USAGE INSTRUCTION
• MUnit matchers are always used in combination with the Mocks, Spy, Verify and
Assert message processors, but never on their own.
MUNIT MATCHERS OVER MULE
MESSAGE PROPERTIES
• If you wish to run assertions over Mule message properties and use MUnit matchers,
you can use the valueOf() function.
• To make it easier to write this type of assertions, MUnit offers a another set of MEL
functions that provide direct access for Mule message’s properties ElementMatcher.
messageInboundProperty(propertyName)
• Returns an ElementMatcher for the inbound property with the name
provided.
messageOutboundProperty(propertyName)
messageInvocationProperty(propertyName)
• Returns an ElementMatcher for the outbound property with the name
provided.
• Returns an ElementMatcher for the invocation property with the name
provided.
messageInboundAttachment(propertyName)
messageOutboundAttachment(propertyName)
• Returns an ElementMatcher for the inbound attachment with the name
provided.
• Returns an ElementMatcher for the outbound attachment with the name
provided.

More Related Content

What's hot

IRJET- Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
IRJET-  	  Implementation and Unittests of AWS, Google Storage (Cloud) and Am...IRJET-  	  Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
IRJET- Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
IRJET Journal
 
Item Analysis: Classical and Beyond
Item Analysis: Classical and BeyondItem Analysis: Classical and Beyond
Item Analysis: Classical and Beyond
Mhairi Mcalpine
 
Introduction to Item Response Theory
Introduction to Item Response TheoryIntroduction to Item Response Theory
Introduction to Item Response Theory
OpenThink Labs
 
Ap Power Point Chpt8
Ap Power Point Chpt8Ap Power Point Chpt8
Ap Power Point Chpt8
dplunkett
 
CounterFactual Explanations.pdf
CounterFactual Explanations.pdfCounterFactual Explanations.pdf
CounterFactual Explanations.pdf
Bong-Ho Lee
 
PATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design PatternsPATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design Patterns
Michael Heron
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
Satheesh Sukumaran
 
The application of irt using the rasch model presnetation1
The application of irt using the rasch model presnetation1The application of irt using the rasch model presnetation1
The application of irt using the rasch model presnetation1
Carlo Magno
 
Wrapper feature selection method
Wrapper feature selection methodWrapper feature selection method
Wrapper feature selection method
Amir Razmjou
 
Classical Test Theory (CTT)- By Dr. Jai Singh
Classical Test Theory (CTT)- By Dr. Jai SinghClassical Test Theory (CTT)- By Dr. Jai Singh
Classical Test Theory (CTT)- By Dr. Jai Singh
Academy for Higher Education and Social Science Research
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
Shakil Ahmed
 
Lesson11 more behavioural patterns
Lesson11 more behavioural patternsLesson11 more behavioural patterns
Lesson11 more behavioural patterns
OktJona
 

What's hot (12)

IRJET- Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
IRJET-  	  Implementation and Unittests of AWS, Google Storage (Cloud) and Am...IRJET-  	  Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
IRJET- Implementation and Unittests of AWS, Google Storage (Cloud) and Am...
 
Item Analysis: Classical and Beyond
Item Analysis: Classical and BeyondItem Analysis: Classical and Beyond
Item Analysis: Classical and Beyond
 
Introduction to Item Response Theory
Introduction to Item Response TheoryIntroduction to Item Response Theory
Introduction to Item Response Theory
 
Ap Power Point Chpt8
Ap Power Point Chpt8Ap Power Point Chpt8
Ap Power Point Chpt8
 
CounterFactual Explanations.pdf
CounterFactual Explanations.pdfCounterFactual Explanations.pdf
CounterFactual Explanations.pdf
 
PATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design PatternsPATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
The application of irt using the rasch model presnetation1
The application of irt using the rasch model presnetation1The application of irt using the rasch model presnetation1
The application of irt using the rasch model presnetation1
 
Wrapper feature selection method
Wrapper feature selection methodWrapper feature selection method
Wrapper feature selection method
 
Classical Test Theory (CTT)- By Dr. Jai Singh
Classical Test Theory (CTT)- By Dr. Jai SinghClassical Test Theory (CTT)- By Dr. Jai Singh
Classical Test Theory (CTT)- By Dr. Jai Singh
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
 
Lesson11 more behavioural patterns
Lesson11 more behavioural patternsLesson11 more behavioural patterns
Lesson11 more behavioural patterns
 

Viewers also liked

MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
akashdprajapati
 
Mule tcat server - deploying applications
Mule tcat server - deploying applicationsMule tcat server - deploying applications
Mule tcat server - deploying applications
Shanky Gupta
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
Khan625
 
Cloudhub fabric
Cloudhub fabricCloudhub fabric
Cloudhub fabric
Shanky Gupta
 
Perpetual Help U-Week 2010 Programme Of Activities
Perpetual Help U-Week 2010 Programme Of ActivitiesPerpetual Help U-Week 2010 Programme Of Activities
Perpetual Help U-Week 2010 Programme Of Activities
University of Perpetual Help System DALTA
 
What have you learnt from audience feedback?
What have you learnt from audience feedback?What have you learnt from audience feedback?
What have you learnt from audience feedback?
WillRussell6
 
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
Antika Alanlar
 
#EgresadosInterlat presentación 2016
#EgresadosInterlat presentación 2016#EgresadosInterlat presentación 2016
#EgresadosInterlat presentación 2016
Luis Carlos Chaquea Blanco
 
Makenna morgan hobbies
Makenna morgan hobbiesMakenna morgan hobbies
Makenna morgan hobbies
20morgam
 
Burak Bora High School
Burak Bora High SchoolBurak Bora High School
Burak Bora High School
Abuzer Kadayıf
 
The Secret Balance of The Workshop - by Ahead Event Management
The Secret Balance of The Workshop - by Ahead Event ManagementThe Secret Balance of The Workshop - by Ahead Event Management
The Secret Balance of The Workshop - by Ahead Event Management
Ahead Event Management
 
Configuring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connectorConfiguring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connector
Shanky Gupta
 
Shotlist
ShotlistShotlist
Shotlist
joannadack
 
Mule message structure
Mule message structureMule message structure
Mule message structure
Shanky Gupta
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
Shanky Gupta
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
Shanky Gupta
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scope
Shanky Gupta
 
MuleSoft CloudHub FAQ
MuleSoft CloudHub FAQMuleSoft CloudHub FAQ
MuleSoft CloudHub FAQ
Shanky Gupta
 
Magazine name ideas
Magazine name ideasMagazine name ideas
Magazine name ideas
emilyallenxx
 
Mule testing
Mule testingMule testing
Mule testing
Shanky Gupta
 

Viewers also liked (20)

MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 
Mule tcat server - deploying applications
Mule tcat server - deploying applicationsMule tcat server - deploying applications
Mule tcat server - deploying applications
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Cloudhub fabric
Cloudhub fabricCloudhub fabric
Cloudhub fabric
 
Perpetual Help U-Week 2010 Programme Of Activities
Perpetual Help U-Week 2010 Programme Of ActivitiesPerpetual Help U-Week 2010 Programme Of Activities
Perpetual Help U-Week 2010 Programme Of Activities
 
What have you learnt from audience feedback?
What have you learnt from audience feedback?What have you learnt from audience feedback?
What have you learnt from audience feedback?
 
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
0531 981 01 90 FATİH KİTAP ALANLAR-PLAK-KİTAP-ANTİKA EŞYA SATIN ALANLAR 0531 ...
 
#EgresadosInterlat presentación 2016
#EgresadosInterlat presentación 2016#EgresadosInterlat presentación 2016
#EgresadosInterlat presentación 2016
 
Makenna morgan hobbies
Makenna morgan hobbiesMakenna morgan hobbies
Makenna morgan hobbies
 
Burak Bora High School
Burak Bora High SchoolBurak Bora High School
Burak Bora High School
 
The Secret Balance of The Workshop - by Ahead Event Management
The Secret Balance of The Workshop - by Ahead Event ManagementThe Secret Balance of The Workshop - by Ahead Event Management
The Secret Balance of The Workshop - by Ahead Event Management
 
Configuring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connectorConfiguring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connector
 
Shotlist
ShotlistShotlist
Shotlist
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scope
 
MuleSoft CloudHub FAQ
MuleSoft CloudHub FAQMuleSoft CloudHub FAQ
MuleSoft CloudHub FAQ
 
Magazine name ideas
Magazine name ideasMagazine name ideas
Magazine name ideas
 
Mule testing
Mule testingMule testing
Mule testing
 

More from Shanky Gupta

Mule tcat server - common problems and solutions
Mule tcat server - common problems and solutionsMule tcat server - common problems and solutions
Mule tcat server - common problems and solutions
Shanky Gupta
 
Anypoint access management - Roles
Anypoint access management - RolesAnypoint access management - Roles
Anypoint access management - Roles
Shanky Gupta
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and Permissions
Shanky Gupta
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain support
Shanky Gupta
 
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring a serverMule tcat server - Monitoring a server
Mule tcat server - Monitoring a server
Shanky Gupta
 
Mule tcat server - Monitoring applications
Mule tcat server - Monitoring applicationsMule tcat server - Monitoring applications
Mule tcat server - Monitoring applications
Shanky Gupta
 
Mule tcat server - automating tasks
Mule tcat server - automating tasks Mule tcat server - automating tasks
Mule tcat server - automating tasks
Shanky Gupta
 
Mule management console Architecture
Mule management console ArchitectureMule management console Architecture
Mule management console Architecture
Shanky Gupta
 
CloudHub networking guide
CloudHub networking guideCloudHub networking guide
CloudHub networking guide
Shanky Gupta
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
Shanky Gupta
 
Mule management console
Mule management consoleMule management console
Mule management console
Shanky Gupta
 
Cloudhub and Mule
Cloudhub and MuleCloudhub and Mule
Cloudhub and Mule
Shanky Gupta
 
Mule Security
Mule SecurityMule Security
Mule Security
Shanky Gupta
 
Anypoint access management - Users
Anypoint access management - UsersAnypoint access management - Users
Anypoint access management - Users
Shanky Gupta
 
Anypoint access management
Anypoint access management Anypoint access management
Anypoint access management
Shanky Gupta
 
The Mule Agent
The Mule AgentThe Mule Agent
The Mule Agent
Shanky Gupta
 
MUnit - Testing Mule
MUnit - Testing MuleMUnit - Testing Mule
MUnit - Testing Mule
Shanky Gupta
 
Cloud hub scalability and availability
Cloud hub scalability and availabilityCloud hub scalability and availability
Cloud hub scalability and availability
Shanky Gupta
 
Cloud hub architecture
Cloud hub architectureCloud hub architecture
Cloud hub architecture
Shanky Gupta
 
OAuth 2.0 authorization
OAuth 2.0 authorization OAuth 2.0 authorization
OAuth 2.0 authorization
Shanky Gupta
 

More from Shanky Gupta (20)

Mule tcat server - common problems and solutions
Mule tcat server - common problems and solutionsMule tcat server - common problems and solutions
Mule tcat server - common problems and solutions
 
Anypoint access management - Roles
Anypoint access management - RolesAnypoint access management - Roles
Anypoint access management - Roles
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and Permissions
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain support
 
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring a serverMule tcat server - Monitoring a server
Mule tcat server - Monitoring a server
 
Mule tcat server - Monitoring applications
Mule tcat server - Monitoring applicationsMule tcat server - Monitoring applications
Mule tcat server - Monitoring applications
 
Mule tcat server - automating tasks
Mule tcat server - automating tasks Mule tcat server - automating tasks
Mule tcat server - automating tasks
 
Mule management console Architecture
Mule management console ArchitectureMule management console Architecture
Mule management console Architecture
 
CloudHub networking guide
CloudHub networking guideCloudHub networking guide
CloudHub networking guide
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
Mule management console
Mule management consoleMule management console
Mule management console
 
Cloudhub and Mule
Cloudhub and MuleCloudhub and Mule
Cloudhub and Mule
 
Mule Security
Mule SecurityMule Security
Mule Security
 
Anypoint access management - Users
Anypoint access management - UsersAnypoint access management - Users
Anypoint access management - Users
 
Anypoint access management
Anypoint access management Anypoint access management
Anypoint access management
 
The Mule Agent
The Mule AgentThe Mule Agent
The Mule Agent
 
MUnit - Testing Mule
MUnit - Testing MuleMUnit - Testing Mule
MUnit - Testing Mule
 
Cloud hub scalability and availability
Cloud hub scalability and availabilityCloud hub scalability and availability
Cloud hub scalability and availability
 
Cloud hub architecture
Cloud hub architectureCloud hub architecture
Cloud hub architecture
 
OAuth 2.0 authorization
OAuth 2.0 authorization OAuth 2.0 authorization
OAuth 2.0 authorization
 

Recently uploaded

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 

Recently uploaded (20)

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 

MUnit matchers

  • 2. OVERVIEW MUnit matchers are a set of MEL functions that help in the creation of mocks and validations (verifications/assertions). They enable you to define mocks, verifications and assertions in terms of general values rather than specific hardcoded values. A matcher is a boolean function. In most of the MUnit matchers, this function is a class type comparison. Its purpose is to validate if an argument belongs to a certain class type. A matcher does not receive parameters; rather, it’s a parameter itself.
  • 3. isNull() • Matches if the evaluated object is Null. isNotNull() • Matches if the evaluated object is not Null.
  • 4. anyObject() • Matches if the evaluated object is an Object. anyBoolean() • Matches if the evaluated object is a Boolean.
  • 5. anyByte() anyByteArray() • Matches if the evaluated object is a Byte. • Matches if the evaluated object is a ByteArray.
  • 6. anyInt() anyDouble() • Matches if the evaluated object is a Double. • Matches if the evaluated object is an Integer.
  • 7. anyFloat() anyShort() • Matches if the evaluated object is a Short. • Matches if the evaluated object is a Float.
  • 8. anyString() anyCollection() • Matches if the evaluated object is a Collection. • Matches if the evaluated object is a String.
  • 9. anyList() anySet() anyMap() • Matches if the evaluated object is a List. • Matches if the evaluated object is a Set. • Matches if the evaluated object is a Map.
  • 10. …MATCHER FUNCTIONS CONTINUED MUnit also offers some additional, rather specific, type of matchers. These matchers evaluate thecontent of the parameter, not its type; even so, they do not evaluate by specific values. matchRegex(<regex>) matchContains(<string_to_look_for>) • Matches if the value of the attribute during the test run verifies the user-provided regular expression • Matches if the value of the attribute during the test run contains the specified user- provided string.
  • 11. USAGE INSTRUCTION • MUnit matchers are always used in combination with the Mocks, Spy, Verify and Assert message processors, but never on their own.
  • 12. MUNIT MATCHERS OVER MULE MESSAGE PROPERTIES • If you wish to run assertions over Mule message properties and use MUnit matchers, you can use the valueOf() function. • To make it easier to write this type of assertions, MUnit offers a another set of MEL functions that provide direct access for Mule message’s properties ElementMatcher. messageInboundProperty(propertyName) • Returns an ElementMatcher for the inbound property with the name provided.
  • 13. messageOutboundProperty(propertyName) messageInvocationProperty(propertyName) • Returns an ElementMatcher for the outbound property with the name provided. • Returns an ElementMatcher for the invocation property with the name provided.
  • 14. messageInboundAttachment(propertyName) messageOutboundAttachment(propertyName) • Returns an ElementMatcher for the inbound attachment with the name provided. • Returns an ElementMatcher for the outbound attachment with the name provided.