#![allow(unused_imports)]
use crate::sdk::{self, types};
use crate::support;
#[tokio::test]
async fn reports_api_errors() {
let body = support::json(r#"{"code":"not_found","message":"No such resource.","details":{"field":"id"}}"#);
let reply = support::Reply::json(404, body).header("x-request-id", "req_test");
let api = support::MockApi::start(vec![reply]).await;
let params: types::InvitationsCreateParams = support::from_json(r#"{
"projectId": "projectId 1",
"accountName": "accountName 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "user@example.com",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"returnUrl": "https://example.com/return-url",
"expiresInDays": 7,
"metadata": {
"key": "value 1"
}
}"#);
let error = api.client().invitations().create(params).await.unwrap_err();
assert!(matches!(error, sdk::Error::Api { .. }), "{error:?}");
assert_eq!(error.status(), Some(404));
assert_eq!(error.code(), "not_found");
assert_eq!(error.request_id(), Some("req_test"));
assert_eq!(error.details().and_then(|d| d.get("field")), Some(&"id".into()));
assert_eq!(error.to_string(), "No such resource. (404 not_found, request req_test)");
assert_eq!(api.calls().await.len(), 1);
}
#[tokio::test]
async fn create() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::json(201, response.clone())]).await;
let params: types::InvitationsCreateParams = support::from_json(r#"{
"projectId": "projectId 1",
"accountName": "accountName 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "user@example.com",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"returnUrl": "https://example.com/return-url",
"expiresInDays": 7,
"metadata": {
"key": "value 1"
}
}"#);
let result = api.client().invitations().create(params).await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "POST");
assert_eq!(calls[0].path, "/v1/invitations");
assert_eq!(calls[0].query, support::pairs(&[]));
support::assert_json(&calls[0].body, &support::json(r#"{
"projectId": "projectId 1",
"accountName": "accountName 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "user@example.com",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"returnUrl": "https://example.com/return-url",
"expiresInDays": 7,
"metadata": {
"key": "value 1"
}
}"#));
assert!(calls[0].header(sdk::IDEMPOTENCY_HEADER).is_some_and(|key| !key.is_empty()));
}
#[tokio::test]
async fn create_without_params() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::json(201, response.clone())]).await;
let result = api.client().invitations().create(Default::default()).await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "POST");
assert_eq!(calls[0].path, "/v1/invitations");
assert_eq!(calls[0].query, support::pairs(&[]));
support::assert_json(&calls[0].body, &support::json(r#"{}"#));
assert!(calls[0].header(sdk::IDEMPOTENCY_HEADER).is_some_and(|key| !key.is_empty()));
}
#[tokio::test]
async fn create_retries_with_one_key() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::status(503), support::Reply::json(201, response.clone())]).await;
let params: types::InvitationsCreateParams = support::from_json(r#"{
"projectId": "projectId 1",
"accountName": "accountName 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "user@example.com",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"returnUrl": "https://example.com/return-url",
"expiresInDays": 7,
"metadata": {
"key": "value 1"
}
}"#);
let result = api.client().invitations().create(params).await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 2);
let key = calls[0].header(sdk::IDEMPOTENCY_HEADER).unwrap();
assert!(!key.is_empty());
assert_eq!(calls[1].header(sdk::IDEMPOTENCY_HEADER), Some(key));
assert_eq!(calls[0].body, calls[1].body);
}
#[tokio::test]
async fn list_streams_every_page() {
let first = support::json(r#"{
"object": "list",
"items": [
{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}
],
"nextCursor": "cursor_2"
}"#);
let last = support::json(r#"{
"object": "list",
"items": [
{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}
],
"nextCursor": null
}"#);
let api = support::MockApi::start(vec![
support::Reply::json(200, first),
support::Reply::json(200, last),
])
.await;
let params: types::InvitationsListParams = support::from_json(r#"{"status":"pending","limit":50,"cursor":"cursor 1","projectId":"ext:customer_8812"}"#);
let items = api.client().invitations().list(params).to_vec().await.unwrap();
support::assert_json(&items, &support::json(r#"[
{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
},
{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}
]"#));
let calls = api.calls().await;
assert_eq!(calls.len(), 2);
assert_eq!(calls[0].method, "GET");
assert_eq!(calls[0].path, "/v1/invitations");
assert_eq!(calls[0].query, support::pairs(&[("status", "pending"), ("limit", "50"), ("projectId", "ext:customer_8812"), ("cursor", "cursor 1")]));
assert_eq!(calls[1].query, support::pairs(&[("status", "pending"), ("limit", "50"), ("projectId", "ext:customer_8812"), ("cursor", "cursor_2")]));
}
#[tokio::test]
async fn list_fetches_one_page() {
let page = support::json(r#"{
"object": "list",
"items": [
{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}
],
"nextCursor": null
}"#);
let api = support::MockApi::start(vec![support::Reply::json(200, page.clone())]).await;
let result = api.client().invitations().list(Default::default()).page().await.unwrap();
support::assert_json(&result, &page);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "GET");
assert_eq!(calls[0].path, "/v1/invitations");
assert_eq!(calls[0].query, support::pairs(&[]));
}
#[tokio::test]
async fn get() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::json(200, response.clone())]).await;
let result = api.client().invitations().get("q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k").await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "GET");
assert_eq!(calls[0].path, "/v1/invitations/q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k");
assert_eq!(calls[0].query, support::pairs(&[]));
assert!(calls[0].body.is_none());
assert!(calls[0].header(sdk::IDEMPOTENCY_HEADER).is_none());
}
#[tokio::test]
async fn cancel() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::json(200, response.clone())]).await;
let result = api.client().invitations().cancel("q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k").await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "POST");
assert_eq!(calls[0].path, "/v1/invitations/q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k/cancel");
assert_eq!(calls[0].query, support::pairs(&[]));
assert!(calls[0].body.is_none());
assert!(calls[0].header(sdk::IDEMPOTENCY_HEADER).is_some_and(|key| !key.is_empty()));
}
#[tokio::test]
async fn cancel_retries_with_one_key() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::status(503), support::Reply::json(200, response.clone())]).await;
let result = api.client().invitations().cancel("q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k").await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 2);
let key = calls[0].header(sdk::IDEMPOTENCY_HEADER).unwrap();
assert!(!key.is_empty());
assert_eq!(calls[1].header(sdk::IDEMPOTENCY_HEADER), Some(key));
assert_eq!(calls[0].body, calls[1].body);
}
#[tokio::test]
async fn resend() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::json(200, response.clone())]).await;
let result = api.client().invitations().resend("q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k").await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].method, "POST");
assert_eq!(calls[0].path, "/v1/invitations/q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k/resend");
assert_eq!(calls[0].query, support::pairs(&[]));
assert!(calls[0].body.is_none());
assert!(calls[0].header(sdk::IDEMPOTENCY_HEADER).is_some_and(|key| !key.is_empty()));
}
#[tokio::test]
async fn resend_retries_with_one_key() {
let response = support::json(r#"{
"object": "invitation",
"id": "id 1",
"projectId": "projectId 1",
"status": "pending",
"url": "url 1",
"inviteeName": "inviteeName 1",
"inviteeEmail": "inviteeEmail 1",
"inviteePhone": "inviteePhone 1",
"suggestedCountry": "suggestedCountry 1",
"proxyLocation": {
"country": "country 1",
"city": "city 1",
"strictCity": false
},
"methods": [
"qr_code"
],
"historySync": "none",
"accountName": "accountName 1",
"accountId": "accountId 1",
"failureReason": "failureReason 1",
"returnUrl": "returnUrl 1",
"metadata": {
"key": "value 1"
},
"emailSentAt": "2026-09-24T09:00:00.000Z",
"expiresAt": "2026-09-24T09:00:00.000Z",
"viewedAt": "2026-09-24T09:00:00.000Z",
"startedAt": "2026-09-24T09:00:00.000Z",
"completedAt": "2026-09-24T09:00:00.000Z",
"createdAt": "2026-09-24T09:00:00.000Z",
"updatedAt": "2026-09-24T09:00:00.000Z"
}"#);
let api = support::MockApi::start(vec![support::Reply::status(503), support::Reply::json(200, response.clone())]).await;
let result = api.client().invitations().resend("q64x2v7b1n9m3c8z5a0s4d6f2g7h1j3k").await.unwrap();
support::assert_json(&result, &response);
let calls = api.calls().await;
assert_eq!(calls.len(), 2);
let key = calls[0].header(sdk::IDEMPOTENCY_HEADER).unwrap();
assert!(!key.is_empty());
assert_eq!(calls[1].header(sdk::IDEMPOTENCY_HEADER), Some(key));
assert_eq!(calls[0].body, calls[1].body);
}