Automated integration testing for complex integration environments is always a big challenge. Due to the complexity, such integration testing is unfortunately quite often being done manually. These manual tests need numerous tools and come with a high cost. Therefore, the leak of test automation frequently causes the leak of test coverage, and over time can influence product quality. Manual testing also brings with it undesirable side-effects like longer development times, lower agility and increased budgets.
The purpose of this blog is to target the problem of test automation, with a particular focus on IBM Integration Bus. It suggests the approach, based on the open-source test.rockITizer framework which helps enable JUnit-based integration testing for IBM Integration Bus. It is free and distributed under MIT Licence, which means you can freely use, change and redistribute the code.
JUnit based integration testing for IBM Integration Bus with test.rockITizer
The test.rockITizer framework treats IBM Integration Bus as a blackbox. It is based on record / replay / assert logic and compares the current system / interface snapshot with recorded master results using the numerous built-in and user-defined assertions. Therefore it keeps you informed on any suspicious change of system behavior.
Furthermore, the framework enables a “Test Driven Development” approach, where iterative development work can aim towards a pre-defined “target” interface, by making changes until the replay snapshot matches.
The framework’s runtime supports several connectors out of the box:
MQ / HTTP / DB / SCP, which should be sufficient for most common usecases.
The setup consists of the following components:
- A Runtime maven project built as a jar file which contains the implementation of execution runtime, connectors and assertions
- A Test.Project which is a runtime jar which can be placed in your classpath and contains connector configuration, testplans, and junit starters with assertions
Thanks to declarative test plan concept, the test plan knows the IN and OUT connectors of the underlying container (IBM Integration Bus) and stores their payloads on the file system. This makes the test plans, including connectors and payloads environment independent and only has to be created once.
– The Test plan has an environment neutral folder structure:
– The Connector is an environment neutral folder following a convention like:
– protcol: MQ, HTTP, DB, or SCP etc.
– type GET or PUT
– ID:key from configuration (the value is environment dependent)
<testname> JUnit serves as glue, triggering test execution which basically is comprised of the following steps:
- Add the steps (step folders) to execution. The rest of processing lies by the framework, based on connector types
- Store the payloads for the
GETconnectors in the corresponding
- Runs the built-in and configured assertions
- Writes test protocol
There is also a more detailed junit starter available which includes an example.
Hands on sample project
If you would like to try JUnit based integration testing for IBM Integration Bus with test.rockITizer, you can do so with the sample project provided by Rockit Consulting. For instructions, see Getting started in the Rockit Consulting documentation.
If you need help trying test.rockITizer, you can email firstname.lastname@example.org.
With environment neutral test plan you are able to write the test once and run it anywhere. The junit based test project, allowes you fine tuning and extension of the test logic. It is easy to integrate the test suites in your contionous build and delivery routine. The record/reply and assert approach allowes you easy tracking of your changes in business logic, using the same test plan to re-record the master data if needed.
Moreover the test.rockitizer saves you the time, replacing the bunch of tools like dbviewer, rfhutil, winscp and forces the “test first” approach in your integration development process.