Integration testing overview

You can create and run unit tests to validate the operation of your IBM® App Connect Enterprise flows and message flow nodes.

IBM App Connect Enterprise facilitates test-driven development through its test framework, which makes it easier to adopt new product versions and make architectural changes, such as modernizing and moving to a container-based environment. You can use integration tests to check whether your integration flows operate as expected after development changes, upgrades, or changes to services that your flow interacts with. You might also want to check whether changes to external services have impacted the operation of your flows. By using this integration test capability as part of your test-driven development, you can develop and run unit tests more rapidly as part of a pipeline, without the need for third-party tools.

In addition to the test framework for running unit tests in the integration server process, the IBM App Connect Enterprise Toolkit provides powerful tools to help you write the tests, including a template that you can use as a starting point for developing a variety of tests. You can develop spies that spy on the behavior of an individual message flow node, or stubs that describe how you can interact using trained messages to define the behavior of a particular part of the flow. If your flow invokes an external service or a database, you might not have access to that system when you are executing the tests; in this situation it can be useful to record messages and then use them as part of your unit tests, without requiring the external services to be online.

Figure 1. Unit test using trained messages in place of an offline system
This diagram shows a unit test using trained messages in place of an offline system.

App Connect Enterprise also enables interaction with third-party matcher libraries. Support is provided for JUnit assertions and third-party matcher libraries such as Hamcrest, JSONAssert, and XMLUnit, as well as matchers for the App Connect Enterprise message assembly.

In addition to creating and running tests during development, you can test existing flows that have already been deployed, by recording messages in bulk and then using them to generate tests for each of the message flow nodes. To automatically create tests for deployed flows, you switch on recording for the flows, store the messages that flow through them, and then generate tests from those stored message assemblies (.mxml files) by using the ibmint generate tests command. You can extend these generated tests with additional functionality, or you can use the stored message assemblies to write your own tests.

For information about how to develop unit tests for your message flows and nodes, see Developing integration tests.