Testing connectors and validating them on the development site


As a developer, you can test your new or existing custom connectors to check the generated code for errors before deploying them to the production instances. In previous versions, you had to write your own custom code in your editor and run the tests in the backend by using APIs. Using the new BMC Helix Connector Designer, you can directly test the code from within the application, either by providing values for the test script or adding your own test scripts for testing the connector.

You can use the test results to troubleshoot errors early in the connector development process. This prevents tenant administrators and end users from encountering errors when they use custom connectors to design and run flows in BMC Helix Integration Studio.

To reduce the possibility of errors while developing a custom connector, see Best practices for connector development.
After testing your connector by using sample values, start the connector in a docker instance of
BMC Helix Connector Designer to create test flows on a development site, before deploying the connector to your production site. The Test option leverages the test driver functionality that simulates a flow without actually deploying a connector to the BMC Helix Integration Service server and without creating a flow. Test results are displayed immediately.

Important

The Integration Controller must be configured to start and deploy the connectors. For more information about configuring the Integration Controller, see Installing and setting up the connector development environment.

Before you begin

You must set up the BMC Helix Integration Service development environment.

For more information about setting up the environment, see Installing and setting up the connector development environment.

To test a connector

After you generate the connector, test it to check the generated code for errors before deploying the connectors. Add test data and create test scripts for your connector. You can create different test scripts to test different sets of data.

For example, you can define two test scripts: 

  • Script 1 that only tests values that you define in the UI for the connector configuration.
  • Script 2 that includes data for a different set of configuration values defined for your profile. 
  1. To open BMC Helix Connector Designer in your browser, navigate to https://localhost:3000/.
  2. On the Connectors page, select the connector that you want to test, and click .

  3. On the Build tab, click Test.
    Add the data to be used to test the connector. These parameters are the same that you add to the Connector Configuration in BMC Helix Integration Service.
  4. In the Test Data section, add values for testing your connector. You can add multiple values, and then select the appropriate values in the Script Data section. You can add the following values:

    Field nameDescription
    ProfileName-value pair for the profile.
    Configuration

    Add the following configuration:

    For a java script-based connector:

    • Name — configjs

    • Field — Parameters

    • Value — Enter a valid value that returns a valid JSON. For example, {"url":"https://BMC Helix Connector DesignerMachine:3000/api/storage"}

    For a java-based connector:

    • Name — config

    • Field — Parameters

    • Value — Enter a valid value that returns a valid JSON. For example, {"url":"https://BMC Helix Integration StudioMachine","port":"3000"}.

    Important: You must add the configuration values each time you add a test script.

    ParametersName-value pair for the parameters to use for testing.
    ConditionsTesting does not support conditions so remove the conditions defined out-of- the-box.
    DataName-value pair of the data to use for testing. Use the Define Complex Data option to define data that does not fit in the simple name-value pair model. For example, to define a field that contains an array of values, provide the data definition in the JSON format.
  5. In the Script Data section, select the test values for your connector. 

    1. Select a Script Command.
      The field lists the functions for triggers, actions, lookups, and queries available for the connector.

    2. Select a value for the following fields.
      The list displays the values that you defined in the Test Data section. The following options are available:

      • Trigger/Action/Lookup/Query Name

      • Configuration Name

      • Parameter Name

      • Data

    3. In the Flow ID field, enter an identifier for your test flow. Flow ID cannot be blank. 

  6. Click .  The test script with the selected values is added under Test Scripts

    Important

    You can add multiple test scripts by using a combination of values in the Script Data section. For example, you can create one script that only tests values that you define in the UI, and another one that tests values provided for a lookup included in the connector configuration. 

  7. After you have entered the test values, click Save.

  8. To run the test scripts, select the scripts from the Test Scripts section, and click Run Test.
    The selected scripts are run simultaneously. The scripts you defined are run with the test values defined in a separate docker container that BMC Helix Connector Designer creates for testing. After the tests are run, a dialog box with the status of the test is displayed.

  9. To view the test logs, click View logs
    If there is an error, the log file displays the actual output from running the test driver, and the debug information for the test driver. For a successful test, the logs display the actual output of the test driver and the result. The logs include information from two sessions, the actual output from running the test driver and the console output that provides debug information for the test driver. 

    To debug your connector code, see Using your developer tools to resolve issues in the connector code.

To register and start the connector Docker image 

After you test the connector, register the connector for your tenant in BMC Helix Integration Service  and then start the connector in a Docker container of your  BMC Helix Connector Designer instance. Use this instance of the connector to create test flows on a development site, before deploying the connector to your production site. 

  1. To open BMC Helix Connector Designer in your browser, navigate to https://localhost:3000/ and log in.
  2. On the Connectors page, select the connector that you want to start, and click .

  3. On the Build tab, click Start.
    If the connector is not registered to your tenant in BMC Helix Integration Studio, the connector is registered before starting. 

    Important

    If the connector does not start after the registration is complete, to start the connector, click Start again. 

    After you test the connector, and resolve the errors, you can deploy the connector to a production instance.

Was this page helpful? Yes No Submitting... Thank you

Comments