SlideShare a Scribd company logo
2
Most read
3
Most read
6
Most read
MUNIT
RUN AND WAIT SCOPE
Shanky Gupta
FUNCTIONALITY
The Run and Wait scope provided by MUnit allows you to instruct
MUnit to wait until all asynchronous executions have completed.
Hence, test execution does not start until all threads opened by
production code have finished processing.
DEFINING RUN AND WAIT
In some cases, your production code may launch threads that produce key
results. Usually, these are the results that you want to validate. But if those
results are being processed in a separate thread, your test runs and finishes
before that separate thread completes, that is, before the results that you
want to validate are available. To avoid this problem, you can use the run-
and-wait scope.
For the purposes of this presentation, we assume that we are testing the
Mule code in following slides:
Visual Editor view
XML code
MUnit run and wait scope
The goal is to make your test wait until the exampleFlow has finished.
To do so, implement the test as shown below.
1. Define run-and-wait scope.
2. Call the actual production code to test.
DEFINING RUN AND WAIT WITH
JAVA CODE
Java API usage
To define the run-and-wait scope in Java, you need to
implement the Synchronizer abstract class, as shown in the
next slide:
MUnit run and wait scope

More Related Content

PPTX
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
PPT
RabbitMQ.ppt
PDF
UiPath Test Suite Automation and Oracle Cloud ERP and E-Business Suite Use Cases
PPTX
Mulesoft Meetup Roma - CloudHub 2.0: a fully managed, containerized integrati...
PPTX
Test NG Framework Complete Walk Through
PDF
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
PPTX
Mule Runtime: Performance Tuning
PPTX
How To Install Sonar Qube Plugin In Anypoint Studio
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
RabbitMQ.ppt
UiPath Test Suite Automation and Oracle Cloud ERP and E-Business Suite Use Cases
Mulesoft Meetup Roma - CloudHub 2.0: a fully managed, containerized integrati...
Test NG Framework Complete Walk Through
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
Mule Runtime: Performance Tuning
How To Install Sonar Qube Plugin In Anypoint Studio

What's hot (20)

PDF
Unit and integration Testing
PDF
IBM MQ and Kafka, what is the difference?
PDF
Mobile Test Automation - Appium
PDF
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
PPTX
PPTX
Automation testing
PPTX
Angular Unit Testing
PDF
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
PPTX
Management skills in IT - Communication
PPTX
Testing strategies
PPTX
API Automation Testing Using RestAssured+Cucumber
PDF
How to build your containerization strategy
PDF
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
PPT
Amqp Basic
PPTX
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
PDF
Meetup #4 Testing Manifesto
PDF
Getting started with appium
PPTX
Batch Processing with Mule 4
PPT
Patrones Creacionales
PDF
Finally, easy integration testing with Testcontainers
Unit and integration Testing
IBM MQ and Kafka, what is the difference?
Mobile Test Automation - Appium
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
Automation testing
Angular Unit Testing
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
Management skills in IT - Communication
Testing strategies
API Automation Testing Using RestAssured+Cucumber
How to build your containerization strategy
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
Amqp Basic
TestComplete – A Sophisticated Automated Testing Tool by SmartBear
Meetup #4 Testing Manifesto
Getting started with appium
Batch Processing with Mule 4
Patrones Creacionales
Finally, easy integration testing with Testcontainers
Ad

More from Shanky Gupta (20)

PPTX
Mule tcat server - common problems and solutions
PPTX
Anypoint access management - Roles
PPTX
Mule access management - Managing Environments and Permissions
PPTX
Mule: Munit domain support
PPTX
Mule tcat server - Server profiles
PPTX
Mule tcat server - Monitoring a server
PPTX
Mule tcat server - Monitoring applications
PPTX
Mule tcat server - deploying applications
PPTX
Mule tcat server - automating tasks
PPTX
Mule agent notifications
PPTX
Mule message structure
PPTX
Mule management console Architecture
PPTX
MUnit matchers
PPTX
CloudHub networking guide
PPTX
Cloudhub fabric
PPTX
MuleSoft CloudHub FAQ
PPTX
Using mule with web services
PPTX
Mule management console
PPTX
Cloudhub and Mule
PPTX
Configuring Anypoint Studio MQ connector
Mule tcat server - common problems and solutions
Anypoint access management - Roles
Mule access management - Managing Environments and Permissions
Mule: Munit domain support
Mule tcat server - Server profiles
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring applications
Mule tcat server - deploying applications
Mule tcat server - automating tasks
Mule agent notifications
Mule message structure
Mule management console Architecture
MUnit matchers
CloudHub networking guide
Cloudhub fabric
MuleSoft CloudHub FAQ
Using mule with web services
Mule management console
Cloudhub and Mule
Configuring Anypoint Studio MQ connector
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Modernizing your data center with Dell and AMD
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Modernizing your data center with Dell and AMD
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf

MUnit run and wait scope

  • 1. MUNIT RUN AND WAIT SCOPE Shanky Gupta
  • 2. FUNCTIONALITY The Run and Wait scope provided by MUnit allows you to instruct MUnit to wait until all asynchronous executions have completed. Hence, test execution does not start until all threads opened by production code have finished processing.
  • 3. DEFINING RUN AND WAIT In some cases, your production code may launch threads that produce key results. Usually, these are the results that you want to validate. But if those results are being processed in a separate thread, your test runs and finishes before that separate thread completes, that is, before the results that you want to validate are available. To avoid this problem, you can use the run- and-wait scope. For the purposes of this presentation, we assume that we are testing the Mule code in following slides:
  • 6. The goal is to make your test wait until the exampleFlow has finished. To do so, implement the test as shown below.
  • 7. 1. Define run-and-wait scope. 2. Call the actual production code to test.
  • 8. DEFINING RUN AND WAIT WITH JAVA CODE Java API usage To define the run-and-wait scope in Java, you need to implement the Synchronizer abstract class, as shown in the next slide: