How to use the Not contain check in the groovy for header valdiation

My requirement is to Validate the Response which should not contain the header which i listed below.

eg.Header Name :ResponseCheck

when I use below code I can found the header value will be null

assert messageExchange.getResponseHeaders().get("ResponseCheck","message") == '';

but i want to validate that my header itself should not be present in the response in the soap ui.

Upvotes: 0

Views: 320

Answers (1)

Rao
Rao

Reputation: 21379

Just use below Script Assertion

assert null == messageExchange.responseHeaders['ResponseCheck'] 

Upvotes: 2

Related Questions