From a1cf124ca967921230caad050924c566a81770c3 Mon Sep 17 00:00:00 2001 From: Yaroslav Grebnov Date: Sat, 10 Oct 2026 18:30:54 +0200 Subject: [PATCH] Fix expected_calls --- .../minimal-mocked-called-at-least-once.yml | 27 +------ .../misspelled-called-at-least-once.yml | 13 ++- .../one-of-two-mocked-not-called.yml | 29 +------ cli/data/crud-test/http-real-mocked.yml | 53 +------------ cli/data/crud-testsuite/e2e.tse.yml | 79 +++---------------- .../gateway-calls-entitlements.test.yml | 6 +- cli/data/crud-testsuite/gateway-error.te.yml | 26 +----- .../crud-testsuite/gateway-error.test.yml | 5 ++ .../crud-testsuite/http-real-mocked.te.yml | 53 ++----------- cli/data/direct/direct-mocked-grpc.json | 62 ++------------- cli/data/direct/direct-mocked-grpc.yml | 46 ++--------- cli/data/direct/direct-mocked-http.json | 41 +--------- cli/data/direct/direct-mocked-http.yml | 27 +------ cli/data/direct/direct-real-grpc.json | 40 +--------- cli/data/direct/direct-real-grpc.yml | 26 +----- cli/data/direct/direct-real-http.json | 41 +--------- cli/data/direct/direct-real-http.yml | 27 +------ .../fixture-miss-grpc-message.yml | 75 ++---------------- .../fixture-miss/fixture-miss-grpc-method.yml | 75 ++---------------- .../fixture-miss/fixture-miss-http-body.yml | 67 ++-------------- .../fixture-miss-http-path-multiple.yml | 62 ++------------- .../fixture-miss/fixture-miss-http-path.yml | 62 ++------------- .../real-not-calling-dependency.yml | 15 ++-- cli/data/transport-kind/http-real-mocked.yml | 53 +------------ cli/data/transport-kind/socket-grpc-error.yml | 10 +-- .../unknown-service-in-expected-calls.yml | 15 ++-- .../expected-call-unknown-service.yml | 13 ++- .../expected-calls-twice.yml | 29 +------ .../expected-grpc-call-to-http-service.yml | 13 ++- .../expected-http-call-to-grpc-service.yml | 13 ++- .../wrong-call-params.yml | 29 +------ docker/data/direct/direct-mocked-grpc.yml | 46 ++--------- docker/data/direct/direct-mocked-http.yml | 27 +------ docker/data/direct/direct-real-http.yml | 27 +------ 34 files changed, 161 insertions(+), 1071 deletions(-) diff --git a/cli/data/called-at-least-once/minimal-mocked-called-at-least-once.yml b/cli/data/called-at-least-once/minimal-mocked-called-at-least-once.yml index 4bbc7ae..04ed538 100644 --- a/cli/data/called-at-least-once/minimal-mocked-called-at-least-once.yml +++ b/cli/data/called-at-least-once/minimal-mocked-called-at-least-once.yml @@ -14,29 +14,8 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: minimal-mocked-called-at-least-once - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: minimal-mocked-called-at-least-once http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /healthz diff --git a/cli/data/called-at-least-once/misspelled-called-at-least-once.yml b/cli/data/called-at-least-once/misspelled-called-at-least-once.yml index d23e846..9ab2a0f 100644 --- a/cli/data/called-at-least-once/misspelled-called-at-least-once.yml +++ b/cli/data/called-at-least-once/misspelled-called-at-least-once.yml @@ -12,11 +12,8 @@ summary: http: method: GET url: http://127.0.0.1:8083/healthz - expect: - http: - status_code: 200 - calls: - - service_id: misspelled - http: - method: GET - path: /healthz + expected_calls: + - service_id: misspelled + http: + method: GET + path: /healthz diff --git a/cli/data/called-at-least-once/one-of-two-mocked-not-called.yml b/cli/data/called-at-least-once/one-of-two-mocked-not-called.yml index e973a00..e90d49b 100644 --- a/cli/data/called-at-least-once/one-of-two-mocked-not-called.yml +++ b/cli/data/called-at-least-once/one-of-two-mocked-not-called.yml @@ -14,32 +14,11 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: not-called - http: - method: GET - path: /healthz - calls: - - service_id: called + expected_calls: + - service_id: not-called http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /healthz deviations: - field: calls.not-called.count expected: "at least 1" diff --git a/cli/data/crud-test/http-real-mocked.yml b/cli/data/crud-test/http-real-mocked.yml index a87a154..75b80ff 100644 --- a/cli/data/crud-test/http-real-mocked.yml +++ b/cli/data/crud-test/http-real-mocked.yml @@ -15,54 +15,9 @@ summary: http: status_code: 200 body_json: '{"status":"ok"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' \ No newline at end of file + method: GET + path: /healthz \ No newline at end of file diff --git a/cli/data/crud-testsuite/e2e.tse.yml b/cli/data/crud-testsuite/e2e.tse.yml index d09690e..8b11b76 100644 --- a/cli/data/crud-testsuite/e2e.tse.yml +++ b/cli/data/crud-testsuite/e2e.tse.yml @@ -28,57 +28,16 @@ tests: http: status_code: 200 body_json: '{"status":"ok"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' + method: GET + path: /healthz - service_id: gateway http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' + method: GET + path: /check - id: f5497dfbbf8392b4828f5323c07e4b5cc8026790caca7b3065350413bebbd4e3 started_at: 2026-08-19T15:16:47.974744Z finished_at: 2026-08-19T15:16:47.993394Z @@ -96,31 +55,11 @@ tests: http: status_code: 500 body_json: '{"error":"simulated error response"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: + expected_calls: - service_id: gateway http: - request: - method: GET - path: /error - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 500 - headers: - Content-Length: - - "37" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"error":"simulated error response"}' + method: GET + path: /error deviations: - field: status_code expected: "200" diff --git a/cli/data/crud-testsuite/gateway-calls-entitlements.test.yml b/cli/data/crud-testsuite/gateway-calls-entitlements.test.yml index c52d91c..719a81b 100644 --- a/cli/data/crud-testsuite/gateway-calls-entitlements.test.yml +++ b/cli/data/crud-testsuite/gateway-calls-entitlements.test.yml @@ -19,4 +19,8 @@ spec: count: 1 http: method: GET - path: /healthz \ No newline at end of file + path: /healthz + - service_id: gateway + http: + method: GET + path: /check \ No newline at end of file diff --git a/cli/data/crud-testsuite/gateway-error.te.yml b/cli/data/crud-testsuite/gateway-error.te.yml index 9dd2b86..11f2fb8 100644 --- a/cli/data/crud-testsuite/gateway-error.te.yml +++ b/cli/data/crud-testsuite/gateway-error.te.yml @@ -15,31 +15,11 @@ summary: http: status_code: 500 body_json: '{"error":"simulated error response"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: + expected_calls: - service_id: gateway http: - request: - method: GET - path: /error - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 500 - headers: - Content-Length: - - "37" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"error":"simulated error response"}' + method: GET + path: /error deviations: - field: status_code expected: "200" diff --git a/cli/data/crud-testsuite/gateway-error.test.yml b/cli/data/crud-testsuite/gateway-error.test.yml index fd27080..283b5b6 100644 --- a/cli/data/crud-testsuite/gateway-error.test.yml +++ b/cli/data/crud-testsuite/gateway-error.test.yml @@ -13,3 +13,8 @@ spec: http: status: 200 body: '{"status":"ok"}' + calls: + - service_id: gateway + http: + method: GET + path: /error diff --git a/cli/data/crud-testsuite/http-real-mocked.te.yml b/cli/data/crud-testsuite/http-real-mocked.te.yml index a87a154..1739b4e 100644 --- a/cli/data/crud-testsuite/http-real-mocked.te.yml +++ b/cli/data/crud-testsuite/http-real-mocked.te.yml @@ -15,54 +15,13 @@ summary: http: status_code: 200 body_json: '{"status":"ok"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' + method: GET + path: /healthz - service_id: gateway http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' \ No newline at end of file + method: GET + path: /check diff --git a/cli/data/direct/direct-mocked-grpc.json b/cli/data/direct/direct-mocked-grpc.json index 15d714f..c42afee 100644 --- a/cli/data/direct/direct-mocked-grpc.json +++ b/cli/data/direct/direct-mocked-grpc.json @@ -31,66 +31,14 @@ } } }, - "expect": { - "grpc": { - "status": "OK" - }, - "calls": [ - { - "service_id": "direct-mocked-grpc", - "grpc": { - "service": "entitlements.v1.EntitlementsService", - "method": "CheckEntitlement", - "message": { - "customer_id": "customer-1" - } - } - } - ] - }, - "calls": [ + "expected_calls": [ { "service_id": "direct-mocked-grpc", "grpc": { - "request": { - "rpc": "/entitlements.v1.EntitlementsService/CheckEntitlement", - "metadata": { - ":authority": [ - "127.0.0.1:8083" - ], - "content-type": [ - "application/grpc" - ], - "user-agent": [ - "grpc-go/1.84.0" - ] - }, - "message": [ - 10, - 10, - 99, - 117, - 115, - 116, - 111, - 109, - 101, - 114, - 45, - 49 - ] - }, - "response": { - "status": "OK", - "metadata": { - "content-type": [ - "application/grpc+proto" - ] - }, - "message": [ - 8, - 1 - ] + "service": "entitlements.v1.EntitlementsService", + "method": "CheckEntitlement", + "message": { + "customer_id": "customer-1" } } } diff --git a/cli/data/direct/direct-mocked-grpc.yml b/cli/data/direct/direct-mocked-grpc.yml index 6dc85b9..177afa7 100644 --- a/cli/data/direct/direct-mocked-grpc.yml +++ b/cli/data/direct/direct-mocked-grpc.yml @@ -22,46 +22,10 @@ summary: metadata: "content-type": - "application/grpc" - expect: - grpc: - status: OK - calls: - - service_id: direct-mocked-grpc - grpc: - service: entitlements.v1.EntitlementsService - method: CheckEntitlement - message: - customer_id: customer-1 - calls: + expected_calls: - service_id: direct-mocked-grpc grpc: - request: - rpc: /entitlements.v1.EntitlementsService/CheckEntitlement - metadata: - ":authority": - - "127.0.0.1:8083" - "content-type": - - "application/grpc" - "user-agent": - - "grpc-go/1.84.0" - message: - - 10 - - 10 - - 99 - - 117 - - 115 - - 116 - - 111 - - 109 - - 101 - - 114 - - 45 - - 49 - response: - status: OK - metadata: - "content-type": - - "application/grpc+proto" - message: - - 8 - - 1 \ No newline at end of file + service: entitlements.v1.EntitlementsService + method: CheckEntitlement + message: + customer_id: customer-1 \ No newline at end of file diff --git a/cli/data/direct/direct-mocked-http.json b/cli/data/direct/direct-mocked-http.json index 0a7e229..8903a3a 100644 --- a/cli/data/direct/direct-mocked-http.json +++ b/cli/data/direct/direct-mocked-http.json @@ -19,47 +19,12 @@ "status_code": 200 } }, - "expect": { - "http": { - "status_code": 200 - }, - "calls": [ - { - "service_id": "direct-mocked-http", - "http": { - "method": "GET", - "path": "/healthz" - } - } - ] - }, - "calls": [ + "expected_calls": [ { "service_id": "direct-mocked-http", "http": { - "request": { - "method": "GET", - "path": "/healthz", - "headers": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - } - }, - "response": { - "status_code": 200, - "headers": { - "Content-Length": [ - "0" - ], - "Date": [ - "Wed, 19 Aug 2026 15:16:47 GMT" - ] - } - } + "method": "GET", + "path": "/healthz" } } ] diff --git a/cli/data/direct/direct-mocked-http.yml b/cli/data/direct/direct-mocked-http.yml index 8dd12e8..dc7174a 100644 --- a/cli/data/direct/direct-mocked-http.yml +++ b/cli/data/direct/direct-mocked-http.yml @@ -14,29 +14,8 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: direct-mocked-http - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: direct-mocked-http http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /healthz diff --git a/cli/data/direct/direct-real-grpc.json b/cli/data/direct/direct-real-grpc.json index 0fd0110..c3a00bd 100644 --- a/cli/data/direct/direct-real-grpc.json +++ b/cli/data/direct/direct-real-grpc.json @@ -25,46 +25,12 @@ } } }, - "expect": { - "grpc": { - "status": "OK" - }, - "calls": [ - { - "service_id": "direct-real-grpc", - "grpc": { - "service": "ok.v1.OKService", - "method": "OK" - } - } - ] - }, - "calls": [ + "expected_calls": [ { "service_id": "direct-real-grpc", "grpc": { - "request": { - "rpc": "/ok.v1.OKService/OK", - "metadata": { - ":authority": [ - "127.0.0.1:8083" - ], - "content-type": [ - "application/grpc" - ], - "user-agent": [ - "grpc-go/1.84.0" - ] - } - }, - "response": { - "status": "OK", - "metadata": { - "content-type": [ - "application/grpc+proto" - ] - } - } + "service": "ok.v1.OKService", + "method": "OK" } } ] diff --git a/cli/data/direct/direct-real-grpc.yml b/cli/data/direct/direct-real-grpc.yml index 120a4ca..8c83b88 100644 --- a/cli/data/direct/direct-real-grpc.yml +++ b/cli/data/direct/direct-real-grpc.yml @@ -18,28 +18,8 @@ summary: metadata: "content-type": - "application/grpc" - expect: - grpc: - status: OK - calls: - - service_id: direct-real-grpc - grpc: - service: ok.v1.OKService - method: OK - calls: + expected_calls: - service_id: direct-real-grpc grpc: - request: - rpc: /ok.v1.OKService/OK - metadata: - ":authority": - - "127.0.0.1:8083" - "content-type": - - "application/grpc" - "user-agent": - - "grpc-go/1.84.0" - response: - status: OK - metadata: - "content-type": - - "application/grpc+proto" + service: ok.v1.OKService + method: OK diff --git a/cli/data/direct/direct-real-http.json b/cli/data/direct/direct-real-http.json index c741e68..fed44ff 100644 --- a/cli/data/direct/direct-real-http.json +++ b/cli/data/direct/direct-real-http.json @@ -19,47 +19,12 @@ "status_code": 200 } }, - "expect": { - "http": { - "status_code": 200 - }, - "calls": [ - { - "service_id": "direct-real-http", - "http": { - "method": "GET", - "path": "/ok" - } - } - ] - }, - "calls": [ + "expected_calls": [ { "service_id": "direct-real-http", "http": { - "request": { - "method": "GET", - "path": "/ok", - "headers": { - "Accept-Encoding": [ - "gzip" - ], - "User-Agent": [ - "Go-http-client/1.1" - ] - } - }, - "response": { - "status_code": 200, - "headers": { - "Content-Length": [ - "0" - ], - "Date": [ - "Wed, 19 Aug 2026 15:16:47 GMT" - ] - } - } + "method": "GET", + "path": "/ok" } } ] diff --git a/cli/data/direct/direct-real-http.yml b/cli/data/direct/direct-real-http.yml index f0eb8cc..d8c043e 100644 --- a/cli/data/direct/direct-real-http.yml +++ b/cli/data/direct/direct-real-http.yml @@ -14,29 +14,8 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: direct-real-http - http: - method: GET - path: /ok - calls: + expected_calls: - service_id: direct-real-http http: - request: - method: GET - path: /ok - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /ok diff --git a/cli/data/fixture-miss/fixture-miss-grpc-message.yml b/cli/data/fixture-miss/fixture-miss-grpc-message.yml index 497396e..a0cd603 100644 --- a/cli/data/fixture-miss/fixture-miss-grpc-message.yml +++ b/cli/data/fixture-miss/fixture-miss-grpc-message.yml @@ -17,77 +17,14 @@ summary: status_code: 502 body_text: dependency returned non-ok status - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - - calls: - - service_id: entitlements - count: 1 - grpc: - service: entitlements.v1.EntitlementsService - method: CheckEntitlement - message: - customer_id: customer-2 - - calls: + expected_calls: - service_id: entitlements + count: 1 grpc: - request: - rpc: /entitlements.v1.EntitlementsService/CheckEntitlement - metadata: - ":authority": - - "127.0.0.1:8083" - "content-type": - - "application/grpc" - "user-agent": - - "grpc-go/1.84.0" - message: - - 10 - - 10 - - 99 - - 117 - - 115 - - 116 - - 111 - - 109 - - 101 - - 114 - - 45 - - 50 - - response: - status: Unimplemented - metadata: - content-type: - - "application/grpc+proto" - x-e2engine-mock-miss: - - "true" - - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - - response: - status_code: 502 - headers: - Content-Length: - - "34" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - body_json: dependency returned non-ok status + service: entitlements.v1.EntitlementsService + method: CheckEntitlement + message: + customer_id: customer-2 deviations: - field: status_code diff --git a/cli/data/fixture-miss/fixture-miss-grpc-method.yml b/cli/data/fixture-miss/fixture-miss-grpc-method.yml index d3e5dfc..78ac52c 100644 --- a/cli/data/fixture-miss/fixture-miss-grpc-method.yml +++ b/cli/data/fixture-miss/fixture-miss-grpc-method.yml @@ -17,77 +17,14 @@ summary: status_code: 502 body_text: dependency returned non-ok status - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - - calls: - - service_id: entitlements - count: 1 - grpc: - service: entitlements.v1.EntitlementsService - method: UnknownMethod - message: - customer_id: customer-1 - - calls: + expected_calls: - service_id: entitlements + count: 1 grpc: - request: - rpc: /entitlements.v1.EntitlementsService/UnknownMethod - metadata: - ":authority": - - "127.0.0.1:8083" - "content-type": - - "application/grpc" - "user-agent": - - "grpc-go/1.84.0" - message: - - 10 - - 10 - - 99 - - 117 - - 115 - - 116 - - 111 - - 109 - - 101 - - 114 - - 45 - - 49 - - response: - status: Unimplemented - metadata: - content-type: - - "application/grpc+proto" - x-e2engine-mock-miss: - - "true" - - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - - response: - status_code: 502 - headers: - Content-Length: - - "34" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - body_json: dependency returned non-ok status + service: entitlements.v1.EntitlementsService + method: UnknownMethod + message: + customer_id: customer-1 deviations: - field: status_code diff --git a/cli/data/fixture-miss/fixture-miss-http-body.yml b/cli/data/fixture-miss/fixture-miss-http-body.yml index 4f6b83b..4b4fc85 100644 --- a/cli/data/fixture-miss/fixture-miss-http-body.yml +++ b/cli/data/fixture-miss/fixture-miss-http-body.yml @@ -11,71 +11,20 @@ summary: http: method: GET url: http://127.0.0.1:8082/check + response: http: status_code: 502 body_text: dependency returned non-200 status - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: POST - path: /healthz - body_json: '{"customer_id":"customer-2"}' - calls: + + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: POST - path: /healthz - body_json: '{"customer_id":"customer-1"}' - headers: - Accept-Encoding: - - gzip - Content-Length: - - "28" - User-Agent: - - Go-http-client/1.1 - response: - status_code: 501 - headers: - Content-Length: - - "19" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - X-E2engine-Mock-Miss: - - true - body_json: no fixture matched - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 502 - headers: - Content-Length: - - "35" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - body_json: dependency returned non-200 status + method: POST + path: /healthz + body_json: '{"customer_id":"customer-2"}' + deviations: - field: status_code expected: "200" diff --git a/cli/data/fixture-miss/fixture-miss-http-path-multiple.yml b/cli/data/fixture-miss/fixture-miss-http-path-multiple.yml index 0c51cbc..4c16cca 100644 --- a/cli/data/fixture-miss/fixture-miss-http-path-multiple.yml +++ b/cli/data/fixture-miss/fixture-miss-http-path-multiple.yml @@ -11,67 +11,19 @@ summary: http: method: GET url: http://127.0.0.1:8082/check + response: http: status_code: 502 body_text: dependency returned non-200 status - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 501 - headers: - Content-Length: - - "19" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - X-E2engine-Mock-Miss: - - true - body_json: no fixture matched - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 502 - headers: - Content-Length: - - "35" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - body_json: dependency returned non-200 status + method: GET + path: /healthz + deviations: - field: status_code expected: "200" diff --git a/cli/data/fixture-miss/fixture-miss-http-path.yml b/cli/data/fixture-miss/fixture-miss-http-path.yml index 6189366..60af79a 100644 --- a/cli/data/fixture-miss/fixture-miss-http-path.yml +++ b/cli/data/fixture-miss/fixture-miss-http-path.yml @@ -11,67 +11,19 @@ summary: http: method: GET url: http://127.0.0.1:8082/check + response: http: status_code: 502 body_text: dependency returned non-200 status - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 501 - headers: - Content-Length: - - "19" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - X-E2engine-Mock-Miss: - - true - body_json: no fixture matched - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 502 - headers: - Content-Length: - - "35" - Content-Type: - - text/plain; charset=utf-8 - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - X-Content-Type-Options: - - nosniff - body_json: dependency returned non-200 status + method: GET + path: /healthz + deviations: - field: status_code expected: "200" diff --git a/cli/data/real-not-calling-dependency/real-not-calling-dependency.yml b/cli/data/real-not-calling-dependency/real-not-calling-dependency.yml index 8518287..26d0dd4 100644 --- a/cli/data/real-not-calling-dependency/real-not-calling-dependency.yml +++ b/cli/data/real-not-calling-dependency/real-not-calling-dependency.yml @@ -12,12 +12,9 @@ summary: http: method: GET url: http://127.0.0.1:8082/ok - expect: - http: - status_code: 200 - calls: - - service_id: dependency - count: 1 - http: - method: GET - path: /dependency + expected_calls: + - service_id: dependency + count: 1 + http: + method: GET + path: /dependency diff --git a/cli/data/transport-kind/http-real-mocked.yml b/cli/data/transport-kind/http-real-mocked.yml index a87a154..75b80ff 100644 --- a/cli/data/transport-kind/http-real-mocked.yml +++ b/cli/data/transport-kind/http-real-mocked.yml @@ -15,54 +15,9 @@ summary: http: status_code: 200 body_json: '{"status":"ok"}' - expect: - http: - status_code: 200 - body_json: '{"status":"ok"}' - calls: - - service_id: entitlements - count: 1 - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: entitlements + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' - - service_id: gateway - http: - request: - method: GET - path: /check - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "15" - Content-Type: - - application/json - Date: - - Wed, 19 Aug 2026 15:16:47 GMT - body_json: '{"status":"ok"}' \ No newline at end of file + method: GET + path: /healthz \ No newline at end of file diff --git a/cli/data/transport-kind/socket-grpc-error.yml b/cli/data/transport-kind/socket-grpc-error.yml index eae815d..197d64a 100644 --- a/cli/data/transport-kind/socket-grpc-error.yml +++ b/cli/data/transport-kind/socket-grpc-error.yml @@ -13,8 +13,8 @@ summary: target: 127.0.0.1:8083 service: ok.v1.OKService method: OK - expect: - grpc: - status: OK - calls: - - service_id: socket-grpc-error \ No newline at end of file + expected_calls: + - service_id: socket-grpc-error + grpc: + service: ok.v1.OKService + method: OK \ No newline at end of file diff --git a/cli/data/unknown-service-in-expected-calls/unknown-service-in-expected-calls.yml b/cli/data/unknown-service-in-expected-calls/unknown-service-in-expected-calls.yml index 69f9105..40ac871 100644 --- a/cli/data/unknown-service-in-expected-calls/unknown-service-in-expected-calls.yml +++ b/cli/data/unknown-service-in-expected-calls/unknown-service-in-expected-calls.yml @@ -12,12 +12,9 @@ summary: http: method: GET url: http://127.0.0.1:8083/healthz - expect: - http: - status_code: 200 - calls: - - service_id: not-called - count: 1 - http: - method: GET - path: /healthz + expected_calls: + - service_id: not-called + count: 1 + http: + method: GET + path: /healthz diff --git a/cli/data/validate-expected-calls/expected-call-unknown-service.yml b/cli/data/validate-expected-calls/expected-call-unknown-service.yml index 102c46c..c7a9db3 100644 --- a/cli/data/validate-expected-calls/expected-call-unknown-service.yml +++ b/cli/data/validate-expected-calls/expected-call-unknown-service.yml @@ -12,11 +12,8 @@ summary: http: method: GET url: http://127.0.0.1:8082/healthz - expect: - http: - status_code: 200 - calls: - - service_id: missing-service - http: - method: GET - path: /healthz + expected_calls: + - service_id: missing-service + http: + method: GET + path: /healthz diff --git a/cli/data/validate-expected-calls/expected-calls-twice.yml b/cli/data/validate-expected-calls/expected-calls-twice.yml index 2ecd2ee..e549b07 100644 --- a/cli/data/validate-expected-calls/expected-calls-twice.yml +++ b/cli/data/validate-expected-calls/expected-calls-twice.yml @@ -14,33 +14,12 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: expected-calls-twice - count: 2 - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: expected-calls-twice + count: 2 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /healthz deviations: - field: calls.expected-calls-twice.count expected: "2" diff --git a/cli/data/validate-expected-calls/expected-grpc-call-to-http-service.yml b/cli/data/validate-expected-calls/expected-grpc-call-to-http-service.yml index ba4d94a..7b0f9e1 100644 --- a/cli/data/validate-expected-calls/expected-grpc-call-to-http-service.yml +++ b/cli/data/validate-expected-calls/expected-grpc-call-to-http-service.yml @@ -12,11 +12,8 @@ summary: http: method: GET url: http://127.0.0.1:8082/healthz - expect: - http: - status_code: 200 - calls: - - service_id: http-dependency - grpc: - service: example.Dependency - method: Check + expected_calls: + - service_id: http-dependency + grpc: + service: example.Dependency + method: Check diff --git a/cli/data/validate-expected-calls/expected-http-call-to-grpc-service.yml b/cli/data/validate-expected-calls/expected-http-call-to-grpc-service.yml index 1c3e69f..817a194 100644 --- a/cli/data/validate-expected-calls/expected-http-call-to-grpc-service.yml +++ b/cli/data/validate-expected-calls/expected-http-call-to-grpc-service.yml @@ -12,11 +12,8 @@ summary: http: method: GET url: http://127.0.0.1:8082/healthz - expect: - http: - status_code: 200 - calls: - - service_id: grpc-dependency - http: - method: GET - path: /healthz + expected_calls: + - service_id: grpc-dependency + http: + method: GET + path: /healthz diff --git a/cli/data/validate-expected-calls/wrong-call-params.yml b/cli/data/validate-expected-calls/wrong-call-params.yml index 85d02fd..4a19c58 100644 --- a/cli/data/validate-expected-calls/wrong-call-params.yml +++ b/cli/data/validate-expected-calls/wrong-call-params.yml @@ -14,33 +14,12 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 201 - calls: - - service_id: wrong-call-params - count: 1 - http: - method: POST - path: /healthz - calls: + expected_calls: - service_id: wrong-call-params + count: 1 http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: POST + path: /healthz deviations: - field: status_code expected: "201" diff --git a/docker/data/direct/direct-mocked-grpc.yml b/docker/data/direct/direct-mocked-grpc.yml index 6dc85b9..177afa7 100644 --- a/docker/data/direct/direct-mocked-grpc.yml +++ b/docker/data/direct/direct-mocked-grpc.yml @@ -22,46 +22,10 @@ summary: metadata: "content-type": - "application/grpc" - expect: - grpc: - status: OK - calls: - - service_id: direct-mocked-grpc - grpc: - service: entitlements.v1.EntitlementsService - method: CheckEntitlement - message: - customer_id: customer-1 - calls: + expected_calls: - service_id: direct-mocked-grpc grpc: - request: - rpc: /entitlements.v1.EntitlementsService/CheckEntitlement - metadata: - ":authority": - - "127.0.0.1:8083" - "content-type": - - "application/grpc" - "user-agent": - - "grpc-go/1.84.0" - message: - - 10 - - 10 - - 99 - - 117 - - 115 - - 116 - - 111 - - 109 - - 101 - - 114 - - 45 - - 49 - response: - status: OK - metadata: - "content-type": - - "application/grpc+proto" - message: - - 8 - - 1 \ No newline at end of file + service: entitlements.v1.EntitlementsService + method: CheckEntitlement + message: + customer_id: customer-1 \ No newline at end of file diff --git a/docker/data/direct/direct-mocked-http.yml b/docker/data/direct/direct-mocked-http.yml index 8dd12e8..dc7174a 100644 --- a/docker/data/direct/direct-mocked-http.yml +++ b/docker/data/direct/direct-mocked-http.yml @@ -14,29 +14,8 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: direct-mocked-http - http: - method: GET - path: /healthz - calls: + expected_calls: - service_id: direct-mocked-http http: - request: - method: GET - path: /healthz - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /healthz diff --git a/docker/data/direct/direct-real-http.yml b/docker/data/direct/direct-real-http.yml index f0eb8cc..d8c043e 100644 --- a/docker/data/direct/direct-real-http.yml +++ b/docker/data/direct/direct-real-http.yml @@ -14,29 +14,8 @@ summary: response: http: status_code: 200 - expect: - http: - status_code: 200 - calls: - - service_id: direct-real-http - http: - method: GET - path: /ok - calls: + expected_calls: - service_id: direct-real-http http: - request: - method: GET - path: /ok - headers: - Accept-Encoding: - - gzip - User-Agent: - - Go-http-client/1.1 - response: - status_code: 200 - headers: - Content-Length: - - "0" - Date: - - Wed, 19 Aug 2026 15:16:47 GMT + method: GET + path: /ok