Forum Discussion
a_wasink
15 years agoOccasional Contributor
Hi Ole,
I adopted your proposed change and found out that there is a problem with that. The problem is that subsequent MockResponse dispatchers are not evaluated upon request entry because the first MockReponse dispatcher will, in case of no match, always return the default response.
This problem can easily be fixed by adding the following of code to the initTestMockResponse method of the WsdlMockResponseTestStep.
Furthermore I noticed (generally for MockResponse teststeps with a Query/Match) the following two problems;
1) the received request is not shown in the UI
2) though a request assertion correctly fails and the failure is shown in the UI, the testrun does not fail.
The cause of these problems is that in case of Query/Match a new WsdlMockResponse object is created though the UI is bound to the existing WsdlMockResponse object. A possible fix for this problem is to add the following line of code to the internalRun method of the WsdlMockResponseTestStep class (after the result.stopTimer() lines).
Regards,
Arjen
I adopted your proposed change and found out that there is a problem with that. The problem is that subsequent MockResponse dispatchers are not evaluated upon request entry because the first MockReponse dispatcher will, in case of no match, always return the default response.
This problem can easily be fixed by adding the following of code to the initTestMockResponse method of the WsdlMockResponseTestStep.
mockOperation.setDefaultResponse(null);
Furthermore I noticed (generally for MockResponse teststeps with a Query/Match) the following two problems;
1) the received request is not shown in the UI
2) though a request assertion correctly fails and the failure is shown in the UI, the testrun does not fail.
The cause of these problems is that in case of Query/Match a new WsdlMockResponse object is created though the UI is bound to the existing WsdlMockResponse object. A possible fix for this problem is to add the following line of code to the internalRun method of the WsdlMockResponseTestStep class (after the result.stopTimer() lines).
mockResponse.setMockResult(testMockResponse.getMockResult());
Regards,
Arjen