Forum Discussion
Thanks for the reply Rupert.
can you please explain this line in your suggestion:
def callBackRequest = (WsdlTestRequestStep) callBackTestCase.getTestStepsOfType(WsdlTestRequestStep.class).get(0)
I'm pretty new to Groovy and I'm not familiar with the syntax of class name in parens
"callBackRequest = (WsdlTestRequestStep)"
Thanks,
Tim
Hi Tim,
I do appologise for that line, I think I accidentally copied that part in from the other solution (referenced from the link). What that line does (or did in the other solution) was to get hold of the request contained in the other TestCase in order to set the endpoint property to the call back url - it was using WS-Addressing to provide a call back address you see.
In your case the only parts you might need are:
def map = new StringToObjectMap()
map.put("responseData", requestToMock)
def testSuite = context.mockService.project.
getTestSuiteByName("Separate TestSuite")
def callBackTestCase = testSuite.getTestCaseByName("Separate TestCase")
callBackTestCase.run(map, false) //true here means call asynchronously i.e. dont wait to the TestCase to finish first
But... now that you have said that you need to package the mock as a war, then that makes this solution innapropriate since the separate TestCase used to forward the request could not be packaged in the mock!
With that I recomend solution 1 or 2 i.e. I think you need to make a Groovy request based on the mockRequest in order to forward the request on to the actual service. If you need any tips for this please ask.
Cheers,
Rupert
Related Content
- 10 months agolodecesa
- 3 years agokimmatsumoto
- 8 months agoMehwishDaud
Recent Discussions
- 4 days agoemoya