!define jsonToTest {!-{
	"airplanes": [{
		"id": "001",
		"type": "747",
		"brand": "Boeing",
		"seats": "400",
		"airline": "KLM"
	}, {
		"id": "002",
		"type": "737",
		"brand": "Boeing",
		"seats": "400",
		"airline": "Virgin"
	}]
    }
-!}

|script      |mock xml server setup|
|add response|${jsonToTest}        |
|$url=       |get mock server url  |

|script       |json http test                                                |
|get from     |$url                                                          |
|check        |json path count      |airplanes[*]        |2                  |
|check        |json path            |airplanes.length()  |2                  |
|show         |all json path matches|airplanes[*].airline                    |
|check        |all json path matches|airplanes[*].airline|=~/.*KLM.*Virgin.*/|
|check        |json path            |airplanes[0].seats  |400                |
|set json path|airplanes[0].seats   |to                  |300                |
|check        |json path            |airplanes[0].seats  |300                |
|show         |response                                                      |


!define jsonToTest {!-{
	"airplanes": [{
		"id": "001",
		"type": "747",
		"brand": "Boeing",
		"seats": "400",
		"airline": "KLM"
	}, {
		"id": "002",
		"type": "737",
		"brand": "Boeing",
		"seats": "400",
		"airline": "Virgin"
	}]
    }
-!}

|script      |mock xml server setup |
|add response|${jsonToTest}         |
|add response|Broken|with status|500|
|$url=       |get mock server url   |

|script       |json http test                                                |
|get from     |$url                                                          |
|check        |json path count      |airplanes[*]        |2                  |
|check        |json path            |airplanes.length()  |2                  |
|show         |all json path matches|airplanes[*].airline                    |
|check        |all json path matches|airplanes[*].airline|=~/.*KLM.*Virgin.*/|
|check        |json path            |airplanes[0].seats  |400                |
|set json path|airplanes[0].seats   |to                  |300                |
|check        |json path            |airplanes[0].seats  |300                |
|show         |response                                                      |

And now a call which returns an error status code.

|script                       |
|reject|get from       |$url  |
|check |response status|500   |
|check |response       |Broken|

Add sample response with 500 status code, to verify it can be expected with 'reject'
Add sample response with 500 status code, to verify it can be expected with 'reject'
