Description
- In Karate 1.5.2 the assertion
And match x.x == null succeeded when the response contained a real JSON null.
- In Karate 2.0.X the same assertion fails
- A workaround that passes is
And match x.x == '#notpresent'.
Steps to Reproduce
Steps
- Create a feature with the minimal scenario below.
- Run the feature against Karate 1.5.2 and then against Karate 2.0.X.
Minimal reproduction
Feature: null matching regression demo
Scenario: match real null values
* def response = { status: 'ERROR_CREATING', user: null, settings: null }
Then match response.status == 'ERROR_CREATING'
And match response.user == null
And match response.settings == null
Expected Behavior
The following worked in 1.5.2:
Then match response.user == null
And match response.settings == null
Actual Behavior
Error message:
Then match response.user == null
match failed: EQUALS
$ | actual path does not exist (STRING:NULL)
'#notpresent'
null
Karate Version
2.0.6
Java Version
25
Operating System
Linux
Description
And match x.x == nullsucceeded when the response contained a real JSON null.And match x.x == '#notpresent'.Steps to Reproduce
Steps
Minimal reproduction
Expected Behavior
The following worked in 1.5.2:
Actual Behavior
Error message:
Karate Version
2.0.6
Java Version
25
Operating System
Linux