Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mule-MUnit

 Mule-MUnit

ksuhas4455

August 13, 2017
Tweet

More Decks by ksuhas4455

Other Decks in Programming

Transcript

  1. MUnit : • Munit is Beta-version Mule testing framework that

    allows you to: • mock the output of your message processors • write tests in XML or Java • create tests in the Anypoint Studio drag-and-drop interface • insert spy functionality to track what happens before and after a message processor is called • view coverage reports in Studio • run tests with your plugins • access detailed Mule stacktraces that pinpoint message processor failures • integrate with Maven and Surefire for continuous integration support
  2. 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.
  3. Purpose of MUnit : • 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
  4. • 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 • Spy any message processor • Verify message processor calls
  5. • Enable or disable particular tests • See assertion/error reports

    with Mule stack trace • Extend the MUnit framework with plugins • Check visual coverage in Studio • Debug your tests with Studio
  6. MUnit Compatibility : • MUnit is divided among several sub

    modules. From a user’s point of view there are only two that are really important. Both modules are compatible amongst themselves. • The important sub modules are: MUnit Version Mule MUnit Support Version 1.0.x 3.6.x, 3.7.x 1.1.x 3.6.x, 3.7.x
  7. Mule MUnit Support : • The Mule MUnit Support module

    is meant to follow Mule ESB releases: Mule MUnit Support Version Mule ESB Version 3.6.x 3.6.0 to 3.6.x 3.7.x 3.7.0 to 3.7.x
  8. MUnit and Anypoint Studio : • MUnit is fully integrated

    with Anypoint Studio, allowing you to create, design and run MUnit tests just like you would Mule applications. You can also use Anypoint Studio Visual Debugger to debug your MUnit tests.
  9. Using MUnit in Anypoint Studio : MUnit is fully integrated

    with Anypoint Studio. You can use Studio’s graphical interface to: •Create and design MUnit tests •Run your tests •View test results and coverage •Debug your tests
  10. MUnit Suite : • The base of the MUnit Framework

    consists of MUnit Test Suite files. • These files are the .xml files located under the src/test/munit folder in your Mule application’s folder structure. • Each MUnit Test Suite file is a collection of MUnit tests. • It is meant to work on its own, and should be able to run independently from any other MUnit test suite files.
  11. Components of an MUnit Test Suite : An MUnit test

    suite file should contain any combination of the following components: • Imports • Bean Definitions • Before/After Suites • Before/After Tests • MUnit Tests