Creating test cases for event strategies
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.
- In the Run window of the event strategy, click Convert to test.
- Optional: To provide additional details, such as test objectives, fill in the Description field.
- 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
- 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.
- Optional: If you want to check more then one assertion, repeat step 3.
- 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.For more information, see:
- Click Save.
Previous topic Unit testing event strategies Next topic Creating an event type in the Event Catalog