<commit_before>!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                                                      |
<commit_msg>Add sample response with 500 status code, to verify it can be expected with 'reject'<commit_after>!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|
{'fraction_non_alphanumeric': 0.13863636363636364, 'fraction_numerical': 0.027651515151515153, 'mean_word_length': 1.2630676949443016, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3231988', 'n_tokens_mistral': 863, 'n_tokens_neox': 743, 'n_words': 197}