SlideShare a Scribd company logo
How to use Mock component in
MUnit
04-04-2017
Abstract
• The Mock feature provided by MUnit allows
you to define mocked behavior for a message
processor. In this case, MUnit replaces the
normal behavior of the message processor
with the behavior you define. Thus you can
modify how a specific message processor
responds when it is called with a particular set
of attributes.
• .mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
• xmlns:spring="http://www.springframework.org/schema/beans"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
• <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8089"
doc:name="HTTP Listener Configuration"/>
• <flow name="MockFlow">
• <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
• <set-payload value="Hi" doc:name="Set Payload"/>
• <logger message="------#[payload]----" level="INFO" doc:name="Logger"/>
• </flow>
• </mule>
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:mock="http://www.mulesoft.org/schema/mule/mock" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:munit="http://www.mulesoft.org/schema/mule/munit"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/munit
http://www.mulesoft.org/schema/mule/munit/current/mule-munit.xsd
• http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/mock http://www.mulesoft.org/schema/mule/mock/current/mule-mock.xsd">
• <munit:config name="munit" doc:name="MUnit configuration"/>
• <spring:beans>
• <spring:import resource="classpath:Mock.xml"/>
• </spring:beans>
• <munit:test name="Mock-test-suite-MockFlowTest" description="Test">
• <mock:when messageProcessor=".*:.*" doc:name="Mock">
• <mock:with-attributes>
• <mock:with-attribute name="doc:name" whereValue="#['Set Payload']"/>
• </mock:with-attributes>
• <mock:then-return payload="Good Morning!"/>
• </mock:when>
• <flow-ref name="MockFlow" doc:name="MockFlow"/>
• <munit:assert-on-equals expectedValue="Good Morning!" actualValue="#[payload]" doc:name="Assert Equals"/>
• </munit:test>
• </mule>
• Output:
• Reference:
https://docs.mulesoft.com/munit/v/1.1.1/mock
-message-processor

More Related Content

What's hot

Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
sathyaraj Anand
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
sivachandra mandalapu
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
sivachandra mandalapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
mdfkhan625
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
Khan625
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
akshay yeluru
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
sivachandra mandalapu
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
Son Nguyen
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Rajkattamuri
 
How to use processor chain
How to use processor chainHow to use processor chain
How to use processor chain
sivachandra mandalapu
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
javeed_mhd
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Mule flow complete
Mule flow completeMule flow complete
Mule flow complete
Son Nguyen
 

What's hot (13)

Mule message processor or routers
Mule message processor or routersMule message processor or routers
Mule message processor or routers
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
How to use processor chain
How to use processor chainHow to use processor chain
How to use processor chain
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Mule flow complete
Mule flow completeMule flow complete
Mule flow complete
 

Similar to Mock component in munit

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Sunil Komarapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Anand kalla
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Khasim Saheb
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
javeed_mhd
 
Message properties component
Message properties component Message properties component
Message properties component
Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties component
F K
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
princeirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
irfan1008
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Phaniu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
maheshtheapex
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
sivachandra mandalapu
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
Durga Prasad Kakarla
 
Object store
Object storeObject store
Object store
RaviRajuRamaKrishna
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Mohammed246
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Sunil Komarapu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Anand kalla
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Khasim Saheb
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
sivachandra mandalapu
 
Filter expression
Filter expression Filter expression
Filter expression
Sunil Komarapu
 
Filter expression
Filter expression Filter expression
Filter expression
F K
 

Similar to Mock component in munit (20)

How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Message properties component
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Object store
Object storeObject store
Object store
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
 
Filter expression
Filter expression Filter expression
Filter expression
 
Filter expression
Filter expression Filter expression
Filter expression
 

More from sivachandra mandalapu

How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
sivachandra mandalapu
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
sivachandra mandalapu
 
Validation
ValidationValidation
Property place holder
Property place holderProperty place holder
Property place holder
sivachandra mandalapu
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
sivachandra mandalapu
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
sivachandra mandalapu
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
sivachandra mandalapu
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
sivachandra mandalapu
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
sivachandra mandalapu
 
Splitter
SplitterSplitter
Expression
ExpressionExpression
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
sivachandra mandalapu
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
sivachandra mandalapu
 
Sap
SapSap
Salesforce
SalesforceSalesforce
Data Mapper
Data MapperData Mapper
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
sivachandra mandalapu
 
Soap Component
Soap ComponentSoap Component
Soap Component
sivachandra mandalapu
 
Rest Component
Rest ComponentRest Component
Rest Component
sivachandra mandalapu
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
sivachandra mandalapu
 

More from sivachandra mandalapu (20)

How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
 
Validation
ValidationValidation
Validation
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Splitter
SplitterSplitter
Splitter
 
Expression
ExpressionExpression
Expression
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Sap
SapSap
Sap
 
Salesforce
SalesforceSalesforce
Salesforce
 
Data Mapper
Data MapperData Mapper
Data Mapper
 
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
 
Soap Component
Soap ComponentSoap Component
Soap Component
 
Rest Component
Rest ComponentRest Component
Rest Component
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
 

Recently uploaded

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

Mock component in munit

  • 1. How to use Mock component in MUnit 04-04-2017
  • 2. Abstract • The Mock feature provided by MUnit allows you to define mocked behavior for a message processor. In this case, MUnit replaces the normal behavior of the message processor with the behavior you define. Thus you can modify how a specific message processor responds when it is called with a particular set of attributes.
  • 3.
  • 4. • .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" • xmlns:spring="http://www.springframework.org/schema/beans" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> • <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8089" doc:name="HTTP Listener Configuration"/> • <flow name="MockFlow"> • <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> • <set-payload value="Hi" doc:name="Set Payload"/> • <logger message="------#[payload]----" level="INFO" doc:name="Logger"/> • </flow> • </mule>
  • 5.
  • 6. • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:mock="http://www.mulesoft.org/schema/mule/mock" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:munit="http://www.mulesoft.org/schema/mule/munit" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/munit http://www.mulesoft.org/schema/mule/munit/current/mule-munit.xsd • http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/mock http://www.mulesoft.org/schema/mule/mock/current/mule-mock.xsd"> • <munit:config name="munit" doc:name="MUnit configuration"/> • <spring:beans> • <spring:import resource="classpath:Mock.xml"/> • </spring:beans> • <munit:test name="Mock-test-suite-MockFlowTest" description="Test"> • <mock:when messageProcessor=".*:.*" doc:name="Mock"> • <mock:with-attributes> • <mock:with-attribute name="doc:name" whereValue="#['Set Payload']"/> • </mock:with-attributes> • <mock:then-return payload="Good Morning!"/> • </mock:when> • <flow-ref name="MockFlow" doc:name="MockFlow"/> • <munit:assert-on-equals expectedValue="Good Morning!" actualValue="#[payload]" doc:name="Assert Equals"/> • </munit:test> • </mule>