Reading Time: 8 minutes

We’re thrilled to announce support for MUnit in Anypoint Code Builder. Thousands of developers love using MUnit in Anypoint Studio everyday – and for good reason. Unit tests are an important part of building integrations. MUnit makes it easy to create and maintain them. 

Unit testing matters. Your time does, too.

Unit testing with MUnit

Great developers know the importance of unit testing. They understand that investing in unit testing yields higher-quality integrations. Building unit tests helps catch bugs earlier in the software development lifecycle. By modularizing testing, it’s faster to get feedback. Being able to understand every component’s quality improves the quality of the entire integration. In addition, unit testing helps enable continuous integration (CI), making quality an ongoing and automated act. 

Unit testing is crucial but often is a large undertaking. With limited time, developers may have to spend less time building new integrations to create and maintain tests. Some teams spend upwards of 20–50% of their time on creating and maintaining tests. 

Simplify unit tests 

MUnit is a Mule testing framework that allows you to build automated tests for your integrations and APIs more quickly and easily. There’s a reason thousands of developers love using MUnit every day – it just works. MUnit makes it easy to create, maintain, and run unit tests. With time and energy saved, developers can spend less time testing and more time building. 

MUnit: Now available for Anypoint Code Builder 

Until now, MUnit has been available only for developers using Anypoint Studio. Today, we’re excited to bring MUnit support for Anypoint Code Builder. 

Developers can bring their projects and corresponding MUnit tests, from Studio into Anypoint Code Builder – and have it just work. Whether it’s continuing to maintain a mission-critical application that you previously built or collaborating on a new integration with a colleague, support for running MUnit tests in Anypoint Code Builder will help. 

MUnit is built to leverage the benefits of ACB 

In bringing the value of MUnit to Anypoint Code Builder, we also wanted to go the other way: bringing the benefits of Anypoint Code Builder to MUnit. In Anypoint Code Builder, MUnit leverages the speed, intuitiveness, and simplicity of the platform. When importing projects to Code Builder, your MUnit tests are exactly where you’d expect them to be.  

Find tests where you’d expect them 

Under the Testing section of Visual Studio Code, you can find all your MUnit test suites, their corresponding tests. Here, you’ll be able to run unit tests – all of them or by executing a specific test at a time.

Run individual tests or entire suites with just a click
Run individual tests or entire suites with just a click

Debug and maintain tests 

In the same view, you can also debug your MUnit tests. Add breakpoints directly in Anypoint Code Builder’s editor and step through – and step over – points in your testing logic. 

Easily add breakpoints and debug tests directly in Anypoint Code Builder
Easily add breakpoints and debug tests directly in Anypoint Code Builder

Run and understand tests 

Our goal has always been to make developers more productive. With MUnit for Anypoint Code Builder, developers can expect just that. The same patterns that developers love in MUnit will remain unchanged. There is nothing new to learn in order to speed up unit testing creation and maintenance. 

Moreover, developers can expect an even more intuitive experience. Test execution and results are easier to understand in Code Builder. For example, you can run an entire MUnit test suite, immediately and intuitively understand that test execution is in progress. And at a glance, understand what specific tests have passed and what have failed. This way, you can spend less time trying to figure out what the issue is and more time remediating it. 

Understand MUnit test results at a glance in Code Builder

This is just the beginning 

We’re excited to bring MUnit to Anypoint Code Builder. This will help a lot of developers to import their existing, mission-critical projects over to Anypoint Code Builder, test them using MUnit, and keep their integrations robust. 

We’ll continue to add more capabilities to MUnit for Anypoint Code Builder and help you be even more productive in building and maintaining powerful integrations. To see it in action, watch our demo, Support for Existing MUnit Tests in Anypoint Code Builder and make sure to install the Anypoint Code Builder – MUnit Extension today.