Forum Discussion
dusura
16 years agoNew Contributor
I thought I'd post my solution. I used one mock service instead of many separate tests. I used a groovy script for my mock response which starts a test case asynchronously. The test case has a built in delay to simulate "doing some work".
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
holder.declareNamespace( 'ns', 'http://my.namespace.com/')
def contextId = holder.getNodeValue("//ns:ContextId")
context.mockService.project.getTestSuiteByName("Replies").getTestCaseByName("Asynch Reply").run(new com.eviware.soapui.support.types.StringToObjectMap( [ contextId : contextId ]), true)
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
holder.declareNamespace( 'ns', 'http://my.namespace.com/')
def contextId = holder.getNodeValue("//ns:ContextId")
context.mockService.project.getTestSuiteByName("Replies").getTestCaseByName("Asynch Reply").run(new com.eviware.soapui.support.types.StringToObjectMap( [ contextId : contextId ]), true)