Publishing messages

You can publish messages from the Producer configured in the Camel component that uses the Camel transport as a publish action in HCL OneTest API tests.

Before you begin

You must have configured the MEP settings for the publish action. See Configuring the MEP settings for the Camel transport.

Procedure

  1. Create a test that uses MEP by right-clicking the operation and selecting New > Tests > Tests using MEP.
  2. Enter a name for the test, and then click OK.

    For example, the name of the test can be Test-Publish.

    The test is created in the operation. Because the MEP for the publish action was configured, the test is created with the settings configured for the publish action in the MEP tab for an operation. The transport that was set for the MEP is selected.

    For example, the publish action is displayed in the Test Factory for the FTP Camel component that shows the transport connection.Image of the publish action in the test.
  3. Modify any of the settings if they are different from the MEP settings for each of the test steps, if required, for your test.
  4. Run the test.

Results

You have successfully published the message as the Producer.