Forum Discussion

dseel's avatar
dseel
Contributor
15 years ago

Assertions with contains have stopped working

Hi:

I'm using script assertions on some test cases that look like this:

// response must be 400
assert messageExchange.responseHeaders["#status#"].contains("HTTP/1.1 400")
// confirm content type
assert messageExchange.responseHeaders.get("Content-Type").contains("application/xml")

These work fine in SOAPUI Pro 3.5.1. But I'm now trying out 3.6 Beta 2 and the assertions no longer work. It appear the contains is now behaving as an equals, because I have to change the assertions to the below to get them to pass:

// response must be 400
assert messageExchange.responseHeaders["#status#"].contains("HTTP/1.1 400 Bad Request")
// confirm content type
assert messageExchange.responseHeaders.get("Content-Type").contains("application/xml; charset=ISO-8859-1")

Here is the response header in both cases:

HTTP/1.1 400 Bad Request
Date: Wed, 11 Aug 2010 13:19:06 GMT
Server: OmniAccess 8550 WSG
Content-Type: application/xml; charset=ISO-8859-1
Connection: close
Transfer-Encoding: chunked

Let me know if this can be fixed in 3.6 beta 2.

Thanks,
Dave