Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Unit testing a Service MQ rule

Updated on January 14, 2022

Use the unit testing feature to verify that the operations of a Service MQ rule function correctly before you add an external component to your testing process.

Important: Service MQ rules are no longer being actively developed. To avoid upgrade issues when these rules are deprecated, use Service JMS rules instead. For more information about Service JMS rules, see Service JMS rules.

Unit testing provides only partial evidence of a correct implementation. For more comprehensive information on testing services, see the Pega Community article Testing Services and Connectors.

Before you begin, see How to provide test data when testing service rules.

To run a unit test, complete the following steps:

  1. Save the rule form.
  2. Start the Tracer by clicking ActionsTrace. For more information, see Tracing services.
  3. Click ActionsRun.
  4. Complete the form as described in the following table, and then click Execute.
FieldDescription
Requestor Context Select a radio button to define the requestor session is to be used in the test:
  • Use current requestor context — Use your current requestor session (including your RuleSet list, privileges, and current clipboard)
  • Initialize service requestor context — Create a new requestor session based on the APP requestor type and, if the service package requires authentication, another Operator ID instance.

Authentication User IDIf you selected Initialize service requestor context , and the service package instance for the service requires authentication, enter the Operator ID to be used to test the service
Authentication PasswordIf you selected Initialize service requestor context , and the service package instance for the service requires authentication, enter a password for the Operator ID.
Enter Request Data Select a radio button to define the source of request data values for this test:
  • Specify individual request values — This option appears only if the Message Data of the Request tab contains only scalar values, such as strings, numbers, or Boolean values.
  • Invoke Initialization activity — A test activity creates values for the request message values.

Message Header ValuesIf you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Header Field row on the Request tab. Enter a value that corresponds to the Java data type listed.
Message Buffer ValuesIf you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Message Data row listed on the Request tab. Enter a value that corresponds to the Java data type listed.
ActivityIf you selected Invoke Initialization activity , enter here the Activity Name key part of an activity that creates the information from a test MQ request message. The system assumes the Applies To class of the activity matches the Primary Page Class value on the Service tab. If the activity applies to a different class, enter the class name, a period, and the activity name.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us