Skip to main content


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

Creating test cases for event strategies

Updated on July 5, 2022

Validate whether event strategies perform as designed through unit testing. By unit testing the event strategy configuration during development or every time you make a change, you can increase the reliability of your configuration and decrease the cost of fixing design flaws due to early detection.

Before you begin:
  1. Ensure that the current ruleset is enabled to store test cases. For more information, see Creating a test ruleset to store test cases.
  2. Perform a test run of the event strategy configuration and review the results. The results will be the benchmark for further testing. For more information, see Unit testing event strategies.
  1. In the Run window of the event strategy, click Convert to test.
  2. Optional: To provide additional details, such as test objectives, fill in the Description field.
  3. In the Expected results section, add an assertion type. Choose one of the following assertion types:
    • To ensure that the value of a specific event property, a group of properties, or aggregates in the pxResults class meet your expectations, select Property and then click + Properties.

      For more information, see Configuring property assertions

    • To determine whether the expected result is in event strategy output, select List.

      For more information, see Configuring list assertions

    • To ensure that event strategy run time does not exceed a specific value (in seconds), select Expected run time.

      For more information, see Configuring expected run-time assertions

    • To assert on the number of emitted events, select Result count. For example, you can determine that the event strategy passes the unit test when only one event is emitted for three dropped calls within a day.

      For more information, see Configuring result count assertions

  4. Optional: If you want to check more then one assertion, repeat step 3.
  5. Optional: To configure the test environment and determine any additional steps to perform before or after running the test case, click the Setup & Cleanup tab.
  6. Click Save.
What to do next: Running a unit test case

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