SlideShare a Scribd company logo
1 of 10
Introduction to Unit Testing
for Mule Flows using
Munit(Java) - Part 1
January 6, 2015
What is a unit test?
A unit test is an automated piece of code that invokes a unit of work in the system and then checks a single assumption about
the behavior of that unit of work.
A unit of work is a single logical functional use case in the system that can be invoked by some public interface (in most cases). A unit of
work can span a single method, a whole class or multiple classes working together to achieve one single logical purpose that can be
verified.
What makes a good unit test?
1. Able to be fully automated
2. Has full control over all the pieces running (Use mocks or stubs to achieve this isolation when needed)
3. Can be run in any order if part of many other tests
4. Runs in memory (no DB or File access, for example)
5. Consistently returns the same result (You always run the same test, so no random numbers, for example.
save those for integration or range tests)
6. Runs fast
7. Tests a single logical concept in the system
8. Readable
9. Maintainable
10.Trustworthy (when you see its result, you don’t need to debug the code just to be sure)
Why do we need a Unit Test?
1. Tests Reduce Bugs in New Features
2. Tests Reduce Bugs in Existing Features
3. Tests Are Good Documentation
4. Tests Reduce the Cost of Change
5. Tests Improve Design
6. Tests Allow Refactoring
7. Tests Constrain Features
8. Tests Defend Against Other Programmers
Dependencies
Anypoint Studio (any Runtime)
● Junit
● Munit
● Hamcrest
What is JUnit?
JUnit is a simple framework to write repeatable tests. It is an instance of the
xUnit architecture for unit testing frameworks.
What is Munit?
MUnit is a Mule application testing framework that allows you to easily build automated tests for your
integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully
integrated with Maven and Surefire for integration with your continuous deployment environment.
Munit Capabilities
Create your Mule test by writing Mule code
Create your Mule test by writing Java code
Disable flow inbound endpoints
Disable endpoint connectors
Mock outbound endpoints
Mock message processors
Munit Capabilities
Verify message processor calls
Create not only unit tests but also integration tests in a local environment — MUnit allows you to start a local
FTP/SFTP, DB server or mail server
Call the Mule client from Mule code
Assert flow exceptions
Enable or disable particular tests
See assertion/error reports with Mule stack trace
Credits
http://artofunittesting.com/definition-of-a-unit-test/
http://junit.org/
https://docs.mulesoft.com/mule-user-guide/v/3.7/munit
http://www.onjava.com/pub/a/onjava/2003/04/02/javaxpckbk.html

More Related Content

What's hot

Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-applicationNaresh Naidu
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with TomcatSudha Ch
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in muleSindhu VL
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windowsDucat
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applicationskumar gaurav
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in MuleF K
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in muleMohammed246
 
Component bindings in mule
Component bindings in muleComponent bindings in mule
Component bindings in muleSindhu VL
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
Best way to deploy mule application
Best way to deploy mule applicationBest way to deploy mule application
Best way to deploy mule applicationSanjeet Pandey
 
Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule applicationSon Nguyen
 
Introduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeIntroduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeBugRaptors
 
Quartz connector mule
Quartz connector   muleQuartz connector   mule
Quartz connector muleSindhu VL
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in muleAnirban Sen Chowdhary
 
Selenium Automation Framework (SAF).
Selenium Automation Framework (SAF).Selenium Automation Framework (SAF).
Selenium Automation Framework (SAF).Mindtree Ltd.
 
Mule with drools
Mule with droolsMule with drools
Mule with droolsKhan625
 
Cakephp Interview Questions
Cakephp Interview QuestionsCakephp Interview Questions
Cakephp Interview QuestionsPankaj Chauhan
 

What's hot (20)

Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-application
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Component bindings in mule
Component bindings in muleComponent bindings in mule
Component bindings in mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Best way to deploy mule application
Best way to deploy mule applicationBest way to deploy mule application
Best way to deploy mule application
 
Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule application
 
Introduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-TimeIntroduction to jmeter & how to view jmeter Test Result in Real-Time
Introduction to jmeter & how to view jmeter Test Result in Real-Time
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
 
Quartz connector mule
Quartz connector   muleQuartz connector   mule
Quartz connector mule
 
Mule
MuleMule
Mule
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in mule
 
Selenium Automation Framework (SAF).
Selenium Automation Framework (SAF).Selenium Automation Framework (SAF).
Selenium Automation Framework (SAF).
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Cakephp Interview Questions
Cakephp Interview QuestionsCakephp Interview Questions
Cakephp Interview Questions
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 

Similar to Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1

Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1Anand kalla
 
Implementing TDD in for .net Core applications
Implementing TDD in for .net Core applicationsImplementing TDD in for .net Core applications
Implementing TDD in for .net Core applicationsAhmad Kazemi
 
5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit Tests5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit TestsSerena Gray
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Hong Le Van
 
Testing mule
Testing   muleTesting   mule
Testing muleSindhu VL
 
Mule testing
Mule   testingMule   testing
Mule testingSindhu VL
 
Unit Testing vs Integration Testing
Unit Testing vs Integration TestingUnit Testing vs Integration Testing
Unit Testing vs Integration TestingRock Interview
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
Introduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnitIntroduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnitMindfire Solutions
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testingAdam Stephensen
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Mohamed Taman
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testingPavlo Hodysh
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkOnkar Deshpande
 

Similar to Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1 (20)

Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1
 
Munit_in_mule_naveen
Munit_in_mule_naveenMunit_in_mule_naveen
Munit_in_mule_naveen
 
Implementing TDD in for .net Core applications
Implementing TDD in for .net Core applicationsImplementing TDD in for .net Core applications
Implementing TDD in for .net Core applications
 
5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit Tests5 Best Unit Test Frameworks to Automate Unit Tests
5 Best Unit Test Frameworks to Automate Unit Tests
 
Unit testing, principles
Unit testing, principlesUnit testing, principles
Unit testing, principles
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
 
TDD Workshop UTN 2012
TDD Workshop UTN 2012TDD Workshop UTN 2012
TDD Workshop UTN 2012
 
Testing mule
Testing   muleTesting   mule
Testing mule
 
Mule testing
Mule   testingMule   testing
Mule testing
 
Unit Testing vs Integration Testing
Unit Testing vs Integration TestingUnit Testing vs Integration Testing
Unit Testing vs Integration Testing
 
Qtp (2)
Qtp (2)Qtp (2)
Qtp (2)
 
Mule testing
Mule testingMule testing
Mule testing
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Introduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnitIntroduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnit
 
Quality for developers
Quality for developersQuality for developers
Quality for developers
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testing
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 

More from Alex Fernandez

Shipping your logs to elk from mule app/cloudhub part 3
Shipping  your logs to elk from mule app/cloudhub  part 3Shipping  your logs to elk from mule app/cloudhub  part 3
Shipping your logs to elk from mule app/cloudhub part 3Alex Fernandez
 
Shipping your logs to elk from mule app/cloudhub part 2
Shipping your logs to elk from mule app/cloudhub   part 2Shipping your logs to elk from mule app/cloudhub   part 2
Shipping your logs to elk from mule app/cloudhub part 2Alex Fernandez
 
Shipping your logs to elk from mule app/cloudhub part 1
Shipping  your logs to elk from mule app/cloudhub   part 1Shipping  your logs to elk from mule app/cloudhub   part 1
Shipping your logs to elk from mule app/cloudhub part 1Alex Fernandez
 
My journey and learnings using mule esb 2
My journey and learnings using mule esb 2My journey and learnings using mule esb 2
My journey and learnings using mule esb 2Alex Fernandez
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1Alex Fernandez
 
Spring batch introduction
Spring batch introductionSpring batch introduction
Spring batch introductionAlex Fernandez
 
Creating debian package in mule apps 1
Creating debian package in mule apps 1Creating debian package in mule apps 1
Creating debian package in mule apps 1Alex Fernandez
 
Data communication part 6
Data communication  part 6Data communication  part 6
Data communication part 6Alex Fernandez
 
Data communication Part 11
Data communication Part 11Data communication Part 11
Data communication Part 11Alex Fernandez
 
Data communication part 8
Data communication part 8Data communication part 8
Data communication part 8Alex Fernandez
 
Data communication part 7
Data communication part 7Data communication part 7
Data communication part 7Alex Fernandez
 
Using schemas in parsing xml part 1
Using schemas in parsing xml part 1Using schemas in parsing xml part 1
Using schemas in parsing xml part 1Alex Fernandez
 
Using schemas in parsing xml part 2
Using schemas in parsing xml part 2Using schemas in parsing xml part 2
Using schemas in parsing xml part 2Alex Fernandez
 
Data Communication Concepts Part 5
Data Communication Concepts Part 5Data Communication Concepts Part 5
Data Communication Concepts Part 5Alex Fernandez
 
Jasper Report - Lesson
Jasper Report - LessonJasper Report - Lesson
Jasper Report - LessonAlex Fernandez
 

More from Alex Fernandez (16)

Shipping your logs to elk from mule app/cloudhub part 3
Shipping  your logs to elk from mule app/cloudhub  part 3Shipping  your logs to elk from mule app/cloudhub  part 3
Shipping your logs to elk from mule app/cloudhub part 3
 
Shipping your logs to elk from mule app/cloudhub part 2
Shipping your logs to elk from mule app/cloudhub   part 2Shipping your logs to elk from mule app/cloudhub   part 2
Shipping your logs to elk from mule app/cloudhub part 2
 
Shipping your logs to elk from mule app/cloudhub part 1
Shipping  your logs to elk from mule app/cloudhub   part 1Shipping  your logs to elk from mule app/cloudhub   part 1
Shipping your logs to elk from mule app/cloudhub part 1
 
My journey and learnings using mule esb 2
My journey and learnings using mule esb 2My journey and learnings using mule esb 2
My journey and learnings using mule esb 2
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1
 
docker compose
docker composedocker compose
docker compose
 
Spring batch introduction
Spring batch introductionSpring batch introduction
Spring batch introduction
 
Creating debian package in mule apps 1
Creating debian package in mule apps 1Creating debian package in mule apps 1
Creating debian package in mule apps 1
 
Data communication part 6
Data communication  part 6Data communication  part 6
Data communication part 6
 
Data communication Part 11
Data communication Part 11Data communication Part 11
Data communication Part 11
 
Data communication part 8
Data communication part 8Data communication part 8
Data communication part 8
 
Data communication part 7
Data communication part 7Data communication part 7
Data communication part 7
 
Using schemas in parsing xml part 1
Using schemas in parsing xml part 1Using schemas in parsing xml part 1
Using schemas in parsing xml part 1
 
Using schemas in parsing xml part 2
Using schemas in parsing xml part 2Using schemas in parsing xml part 2
Using schemas in parsing xml part 2
 
Data Communication Concepts Part 5
Data Communication Concepts Part 5Data Communication Concepts Part 5
Data Communication Concepts Part 5
 
Jasper Report - Lesson
Jasper Report - LessonJasper Report - Lesson
Jasper Report - Lesson
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1

  • 1. Introduction to Unit Testing for Mule Flows using Munit(Java) - Part 1 January 6, 2015
  • 2. What is a unit test? A unit test is an automated piece of code that invokes a unit of work in the system and then checks a single assumption about the behavior of that unit of work. A unit of work is a single logical functional use case in the system that can be invoked by some public interface (in most cases). A unit of work can span a single method, a whole class or multiple classes working together to achieve one single logical purpose that can be verified.
  • 3. What makes a good unit test? 1. Able to be fully automated 2. Has full control over all the pieces running (Use mocks or stubs to achieve this isolation when needed) 3. Can be run in any order if part of many other tests 4. Runs in memory (no DB or File access, for example) 5. Consistently returns the same result (You always run the same test, so no random numbers, for example. save those for integration or range tests) 6. Runs fast 7. Tests a single logical concept in the system 8. Readable 9. Maintainable 10.Trustworthy (when you see its result, you don’t need to debug the code just to be sure)
  • 4. Why do we need a Unit Test? 1. Tests Reduce Bugs in New Features 2. Tests Reduce Bugs in Existing Features 3. Tests Are Good Documentation 4. Tests Reduce the Cost of Change 5. Tests Improve Design 6. Tests Allow Refactoring 7. Tests Constrain Features 8. Tests Defend Against Other Programmers
  • 5. Dependencies Anypoint Studio (any Runtime) ● Junit ● Munit ● Hamcrest
  • 6. What is JUnit? JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
  • 7. What is Munit? MUnit is a Mule application testing framework that allows you to easily build automated tests for your integrations and APIs. It provides a full suite of integration and unit test capabilities, and is fully integrated with Maven and Surefire for integration with your continuous deployment environment.
  • 8. Munit Capabilities Create your Mule test by writing Mule code Create your Mule test by writing Java code Disable flow inbound endpoints Disable endpoint connectors Mock outbound endpoints Mock message processors
  • 9. Munit Capabilities Verify message processor calls Create not only unit tests but also integration tests in a local environment — MUnit allows you to start a local FTP/SFTP, DB server or mail server Call the Mule client from Mule code Assert flow exceptions Enable or disable particular tests See assertion/error reports with Mule stack trace