@@ -1361,7 +1361,7 @@ Feature: to interact with an http service and setup mocks
1361
1361
| {"body ":{"payload ":{"my -body ":{"field ":"a bad value "}}}} |
1362
1362
1363
1363
Scenario : Requests count assertion should also work for digit
1364
- And that getting on "http://backend/pipe/([a-z]*)/([0-9]*)/(\d +)" will return a status OK_200 and:
1364
+ Given that getting on "http://backend/pipe/([a-z]*)/([0-9]*)/(\d +)" will return a status OK_200 and:
1365
1365
"""
1366
1366
$1|$2|$3
1367
1367
"""
@@ -1376,4 +1376,85 @@ Feature: to interact with an http service and setup mocks
1376
1376
c|3|4
1377
1377
"""
1378
1378
And "http://backend/pipe/[a-b]*/1/\d +" has received 1 GET
1379
- And "http://backend/pipe/.*/\d */\d +" has received 2 GETs
1379
+ And "http://backend/pipe/.*/\d */\d +" has received 2 GETs
1380
+
1381
+ Scenario : We can assert the order in which the requests were received
1382
+ Given that getting on "http://backend/firstEndpoint" will return a status OK_200
1383
+ And that posting on "http://backend/secondEndpoint?aParam=1&anotherParam=2" will return a status OK_200
1384
+ And that patching on "http://backend/thirdEndpoint" will return a status OK_200
1385
+ When we get on "http://backend/firstEndpoint"
1386
+ And that we post on "http://backend/secondEndpoint?aParam=1&anotherParam=2" a Request:
1387
+ """
1388
+ headers.some-header: some-header-value
1389
+ body.payload.message: Hello little you!
1390
+ """
1391
+ And that we patch on "http://backend/thirdEndpoint"
1392
+ Then the recorded interactions were in order:
1393
+ """
1394
+ - method: GET
1395
+ path: http://backend/firstEndpoint
1396
+ - method: POST
1397
+ path: http://backend/secondEndpoint?aParam=1&anotherParam=2
1398
+ headers.some-header: some-header-value
1399
+ body:
1400
+ payload:
1401
+ message: Hello little you!
1402
+ - method: PATCH
1403
+ path: ?e http://backend/third.*
1404
+ """
1405
+ And the recorded interactions were:
1406
+ """
1407
+ - method: POST
1408
+ path: http://backend/secondEndpoint?anotherParam=2&aParam=1
1409
+ headers.some-header: ?notNull
1410
+ body:
1411
+ payload:
1412
+ message: Hello little you!
1413
+ - method: PATCH
1414
+ path: ?e http://backend/third.*
1415
+ """
1416
+ But it is not true that the recorded interactions were:
1417
+ """
1418
+ - method: POST
1419
+ path: http://backend/secondEndpoint?anotherParam=2&aParam=1
1420
+ headers.some-header: null
1421
+ body:
1422
+ payload:
1423
+ message: Hello little you!
1424
+ - method: PATCH
1425
+ path: ?e http://backend/third.*
1426
+ """
1427
+ And it is not true that recorded interactions were in order:
1428
+ """
1429
+ - method: POST
1430
+ path: http://backend/secondEndpoint?aParam=1&anotherParam=2
1431
+ body:
1432
+ payload:
1433
+ message: Hello little you!
1434
+ - method: GET
1435
+ path: http://backend/firstEndpoint
1436
+ - method: PATCH
1437
+ path: ?e http://backend/third.*
1438
+ """
1439
+ And it is not true that the recorded interactions were:
1440
+ """
1441
+ - method: POST
1442
+ path: http://backend/secondEndpoint?aParam=1&anotherParam=2
1443
+ body:
1444
+ payload:
1445
+ message: Hello BIG you!
1446
+ - method: GET
1447
+ path: http://backend/firstEndpoint
1448
+ - method: PATCH
1449
+ path: ?e http://backend/third.*
1450
+ """
1451
+ And it is not true that the recorded interactions were only:
1452
+ """
1453
+ - method: GET
1454
+ path: http://backend/firstEndpoint
1455
+ - method: POST
1456
+ path: http://backend/secondEndpoint?aParam=1&anotherParam=2
1457
+ body:
1458
+ payload:
1459
+ message: Hello little you!
1460
+ """
0 commit comments