Testing connectors and validating them on the development site
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.
- To open BMC Helix Connector Designer in your browser, navigate to https://localhost:3000/.
- On the Connectors page, select the connector that you want to test, and click
.
- 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. 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 name
Description
Profile
Name-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.
Parameters
Name-value pair for the parameters to use for testing.
Conditions
Testing does not support conditions so remove the conditions defined out-of- the-box.
Data
Name-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.
- In the Script Data section, select the test values for your connector.
- Select a Script Command.
The field lists the functions for triggers, actions, lookups, and queries available for the connector. - 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
- In the Flow ID field, enter an identifier for your test flow. Flow ID cannot be blank.
- Select a Script Command.
Click
. The test script with the selected values is added under Test Scripts.
- After you have entered the test values, click Save.
- 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. 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.
- To open BMC Helix Connector Designer in your browser, navigate to https://localhost:3000/ and log in.
- On the Connectors page, select the connector that you want to start, and click
.
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.After you test the connector, and resolve the errors, you can deploy the connector to a production instance.