Forum Discussion
M_McDonald
16 years agoSuper Contributor
OK, I came up with something I think is workable.
After the initial request step, I have Groovy step that adds a property to the Mock Service with a name containing the order number and an empty value. The script then goes into a loop in which it sleeps for a while, then checks to see if the value has been populated.
When the Mock Service receives a callback request, in the OnRequest event it extracts the order number, then checks to see if there is a property with a matching name; if there is it fills in the value with the necessary info.
When the script sees the property has been populated, the loop terminates, the info is copied from the Mock Service property, the property is removed from the Mock Service and the test case resumes execution.
After the initial request step, I have Groovy step that adds a property to the Mock Service with a name containing the order number and an empty value. The script then goes into a loop in which it sleeps for a while, then checks to see if the value has been populated.
When the Mock Service receives a callback request, in the OnRequest event it extracts the order number, then checks to see if there is a property with a matching name; if there is it fills in the value with the necessary info.
When the script sees the property has been populated, the loop terminates, the info is copied from the Mock Service property, the property is removed from the Mock Service and the test case resumes execution.