Generating tests by using the ibmint generate tests command

You can use the ibmint generate tests command to generate a test project and unit tests by using recorded messages.

Before you begin

Install Gradle (version 8.2.1 or higher). The Gradle application is not supplied with App Connect Enterprise, but you can install it from https://gradle.org/install/. Read the following topics:

About this task

The command recursively searches for recorded message assemblies in the specified directory name, and analyzes the files that are found, identifying pairs of messages that represent the corresponding input and output messages from the invocation of the message flow node. A Java test case is then created for each pair of messages, and is written to the test project directory together with the recorded message assembly files.

Procedure

  1. Open a command console and run the ibmint generate tests command to generate tests based on the recorded message assembly (.mxml) files:
    
    ibmint generate tests 
     --recorded-messages C:\tmp\IntegrationServer\recorded_messages
     --output-test-project C:\tmp\MyIntegrationTestProject 
     --java-class com.ibm.mytests.MyIntegrationTestClass
    Where:
    • --recorded-messages specifies the file name and path of the recorded messages that are to be used in the tests.
    • --output-test-project specifies the name and location of the generated test project.
    • --java-class specifies the fully qualified classpath of the Java class that will contain the generated tests.
    For more information about the ibmint generate tests command, see ibmint generate tests command
  2. You can import the generated tests into the IBM App Connect Enterprise Toolkit for editing, as described in Importing a test project into the IBM App Connect Enterprise Toolkit for editing, or you can build the tests by using Gradle before you run them on an integration server, as described in Compiling a test project and creating a BAR file by using the command line.