You are here: Reference > Rule types > Service HTTPs > How to unit test a Service HTTP rule

  How to unit test a Service HTTP rule

C-2431Use the unit testing feature to verify that the operations of a Service HTTP rule function correctly before you add the external client to your testing process.

Unit testing provides only partial evidence of a correct implementation. For more comprehensive information on testing services, see the PDN 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. Optionally, select Availability > Trace Open Rule... to start the Tracer. See Tracer tool   — Tracing services. C-2430 byrnb 2/22/10
  3. Click the Run toolbar button.
  4. Complete the form as described in the following table, and then click Execute.

Field

Description

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 ID

If 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
Password

If you selected Initialize service requestor context, and the service package instance for the service requires authentication, enter a password for the Operator ID. B-19275

Enter Request Data

Select a radio button to define the source of request data values for this test:

  • Specify individual request values — Select if you want to manually enter the values for the message data in the Message Buffer text box.
  • Invoke Initialization activity — Select if you want to run an activity that creates the string for the message data.

HTTP Header Values

add row If 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.

Message Buffer

If you selected Specify individual request values, enter or paste the test message data in this text box.

Activity

If you selected Invoke Initialization activity, specify the Activity Name key part of an activity that creates the 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.

About Service HTTP rules