M_McDonald
14 years agoSuper Contributor
[Resolved]IllegalStateException from OnRequest in MockSer...
I had been using a MockService to echo a requests output in multiple request steps so that I could group assertions into smaller chunks. Perhaps I just did not notice before, but I am getting an IllegalStateException following the execution of code in the OnRequest event like this:
I know why this happens (soapUI is calling the Writer when I have already called it in my script) but I wonder if there is a way to prevent it from happening; I get the response I expect but exceptions are expensive.
mockRequest.httpRequest.method = "GET"
resp = mockRequest.requestContent
def writer = mockRequest.httpResponse.writer
writer.print(resp)
writer.close()
I know why this happens (soapUI is calling the Writer when I have already called it in my script) but I wonder if there is a way to prevent it from happening; I get the response I expect but exceptions are expensive.