IBM App Connect Enterprise v12 is bringing lots of innovations to the table. Unit testing is one of the most valuable features worth upgrading to ACE v12. Other characteristics such as new visual appearance, Open API 3 and JSON parser are just additional benefits.
The new App Connect Enterprise (ACE), version 12, is released three years after v11 from 2018. In the last three years, there was a lot of enhancements to the v11. Just browse through the fix pack list on IBM Documentation. You can install and use ACE with equal success as a native installation on various systems, as a Docker image or as a part of the IBM Cloud Pak for Integration. Long gone are the days when IBM MQ was pre-requisite software. With IBM ACE v12 you can still install and use IBM MQ but you are not required to.
To start with ACE it is recommended to download IBM App Connect Enterprise for Developers. Download includes IBM App Connect Enterprise Toolkit which is, to existing users, well known Eclipse-based development environment. With the Toolkit, you also get an ACE server to test developed flows. Everything included is fully featured and free to use if you stay within the terms of the license. The most important thing to notice is that ACE server is limited to process one message per second. But this is something that is well known to the existing ACE users.
What is new in ACE v12?
First, let us talk about the most important news in ACE v12 – Test Driven Development (TDD). Now we can write JUnit tests for the nodes themselves and not only test message flows as a black box. We can do it even in a true TDD manner, write tests before we implement integration logic.
How does writing a Test Case for a node in the message flow works?
First, you need to have Java knowledge. Tests are written as JUnit test classes but you don’t need to start from scratch. ACE Toolkit helps to create JUnit test cases with the wizard available in the context menu. To maximize the potential of the wizard it is recommended to test the flow using a flow exerciser. Therefore, recommended steps are following:
a) Open a message flow using Message Flow Editor,
b) Start the Flow Exerciser for the flow,
c) Send a message to the flow – Flow Exerciser will record the message as it passes through the flow.
The was input message for the node under the test, as well as the output message leaving the node, will be recorded. Those messages can then be used by the Test Case wizard.
- d) As Flow Exerciser is still running right click on the node to create a unit test. Wizard runs and several options are shown. Wizard recognizes recorded input and output messages that were on input and output terminals of the node. References to the files holding messages would be automatically added to the Java source code to be read as the JUnit test executes. Click on Finish to create a JUnit test case.
Running the JUnit test case
JUnit test cases are stored in a Java project named <Application_Name>_Test. As with any JUnit test, you could run a single test or you can run all tests in the project.
However, testing support is very clever. It will create a BAR file for the application under the test. Also, a BAR file would be deployed to the integration server that will run whenever the test case runs. Packaging, deploying, and running the server with an application is very quick. The Server is shared for all the tests run so it is very efficient.
What can I test with the JUnit test case?
The idea behind unit tests is that we are testing a unit in isolation of other components. With message flows a unit is a node within the flow. A node can be of various types. We can test mapping nodes, compute nodes, file readers and so on. When creating the test in most cases we want to record the message using Flow Exerciser. A message will be stored as an XML message in the workspace which leaves us a space to tweak or copy it to be used in various scenarios. With this, we can build a set of scenarios to cover various cases (contexts) in which it could operate. This would be most beneficial in regression testing. We want to ensure that future code changes would not impact the existing functionality of the node. In the future, we might need to change the message model, introduce additional nodes or paths. Having powerful capability such as node unit testing is of paramount importance. For me, just this feature alone is worth of upgrade to the ACE v12.
OpenAPI 3 Support
In recent years OpenAPI 3 gets more and more traction and tooling support. App Connect Enterprise v12 now also brings a visual editor to create APIs that conforms to OpenAPI 3 specification. Editor has 2 views, read-only where we see operations and connect those to the subflow, and an editor that runs in a web browser. Benefit of the web browser editor is that it would be very familiar to the API Connect users. The idea is, as both products are packed within IBM Integration Cloud Pak, that there would be a seamless experience to develop an API in APP Connect Enterprise and then expose the same using API Connect. We welcome this interoperability as it should make life easier for API developers and API managers.
Together with OpenAPI 3 we can also use new validating JavaScript Object Notation (JSON) parser. New parser is now capable of checking inbound and outbound data for compliance against JSON schema (Draft 4) and OpenAPI 3 specification. Validating data in an enterprise environment has always been high on the priority list. With this new parser, we can do a lot just by using JSON Schema. Experienced developers would remember that we had those capabilities using XML Schema 15 years ago but as we live in JSON or even YAML age, we must appreciate the benefits of JSON Schema.
Editor Visual Enhancement
Visual enhancements would not have any impact on runtime performance but most likely it is something you would notice first when you upgrade to App Connect Enterprise V12. It was about time that old icons from the 2000s are replaced. New icons are now more in-tune with Cloud world and other recent IBMs visuals. Looking closely, we can see that node groups are colour-coded. Transformation nodes have blue backgrounds, the error handling group is pink and protocol nodes are with white backgrounds. With nodes in rectangular shape we have more space to read node names. Wires are now of gray colour which makes them non-obtrusive and blend well with the background.
Should you upgrade?
If you ask me, unit testing alone is a feature worth upgrading to ACE v12. Other features such as new icons, Open API 3 and JSON parser are just additional incentives. If you are currently using ACE v11, the migration should be easy and straightforward unlike upgrading from the older version which is a bit more complex. If you need any help upgrading your environment, don’t hesitate to get in touch with us. We can offer various levels of help from consultancy to performing migration for you.
Photo by Fotis Fotopoulos on Unsplash.
Related News