Posted: 3 Oct 2018 13:31 EDT Last activity: 12 Oct 2018 8:12 EDT
Unit Testing Strategies
I am currently looking into unit testing in Pega. Specifically unit testing strategies within Pega. I have been successful with testing some strategies, but have reached a impasse with others. Our strategies are organized in a way that we have a main strategy. This main strategy contains many sub strategies and sub strategies contain strategies themselves. I am having no problem unit testing the initial strategy to which all of the sub strategies stem from. The problem lies for me when I have a sub strategy embedded within another strategy. I am seem to be unable to unit test this sub strategy.
For example lets say I have a strategy named X. In X is a sub-strategy named Y. My problem isn't with testing X it is with testing Y. When I go to where my automated test are listed and run this from the dashboard, my Automated test for Y breaks, but not for X. Yet when I run this unit test individually it works fine. Does anyone know why this might be?
Sorry for the confusion the issue we’re having follows. Testing a strategy using the Test Run panel is helpful due to being able to supply a data transform and checking what the results of the strategy are. We also have a convert to test button as the red arrow denotes(see screen shot). This creates the unit test for the strategy and makes all needed connections. This changes when we are testing a sub strategy that requires an external input as denoted by the blue arrow(see screen shot). When we define what the external input is, and convert to test the external input connection we just defined in the Test run panel is no longer there. Because the connection is no longer there when we run our Test case it is unable to assert anything. This is due to the Sub strategy not being able to properly run without having an external input defined. Do you know why this might be?
Posted: 3 years ago
Posted: 12 Oct 2018 8:12 EDT
Alex Burt (BURTA)
Principal Product Manager - Predictive Analytics