We are using the Logic App Standard Unit Testing Framework () and we have run into an issue where we are unable to mock an HTTP request to an external API. No matter how we build the Mock, we receive live data back from the system.
In larger tests we have been able to mock request to local function app actions, but are unable to mock requests to an external API using the HTTP action.
We have confirmed that all the parameters we use to attempt a match are valid and identical to the action. We've tried several different ways to match.
Test.cs: .cs.txt
Parameters.json: .json
testConfiguration.json: .json
Tests.csproj: .csproj.txt
workflow.json: .json
Sample Data:
{ "users": [ { "id": 1001101, "first_name": "Jack", "last_name": "Wilson", "email": "[email protected]", "telephone": "", "timezone": "Pacific Time (US & Canada)", "weekly_capacity": 144000, "has_access_to_all_future_projects": false, "is_contractor": true, "is_active": true, "calendar_integration_enabled": false, "calendar_integration_source": null, "created_at": "2024-11-05T21:18:55Z", "updated_at": "2024-11-05T21:25:58Z", "can_create_projects": false, "default_hourly_rate": 150, "cost_rate": null, "roles": [ "Integration Developer" ], "access_roles": [ "member" ], "permissions_claims": [ "expenses:read:own", "expenses:write:own", "timers:read:own", "timers:write:own" ], "avatar_url": ".png" }, { "id": 1001102, "first_name": "Sasha", "last_name": "Miller", "email": "[email protected]", "telephone": "", "timezone": "Pacific Time (US & Canada)", "weekly_capacity": 144000, "has_access_to_all_future_projects": false, "is_contractor": true, "is_active": true, "calendar_integration_enabled": false, "calendar_integration_source": null, "created_at": "2024-04-08T19:52:51Z", "updated_at": "2024-05-30T07:48:13Z", "can_create_projects": false, "default_hourly_rate": 0, "cost_rate": 0, "roles": [ "Project Manager" ], "access_roles": [ "member" ], "permissions_claims": [ "expenses:read:own", "expenses:write:own", "timers:read:own", "timers:write:own" ], "avatar_url": ".png" }, { "id": 1001103, "first_name": "Luke", "last_name": "Walker", "email": "[email protected]", "telephone": "", "timezone": "Pacific Time (US & Canada)", "weekly_capacity": 144000, "has_access_to_all_future_projects": false, "is_contractor": true, "is_active": true, "calendar_integration_enabled": false, "calendar_integration_source": null, "created_at": "2024-04-08T19:52:51Z", "updated_at": "2024-05-30T07:48:13Z", "can_create_projects": false, "default_hourly_rate": 0, "cost_rate": 0, "roles": [ "Integration Contractor" ], "access_roles": [ "member" ], "permissions_claims": [ "expenses:read:own", "expenses:write:own", "timers:read:own", "timers:write:own" ], "avatar_url": ".png" } ], "per_page": 2000, "total_pages": 1, "total_entries": 12, "next_page": null, "previous_page": null, "page": 1, "links": { "first": ";page=1&per_page=2000&ref=first", "next": null, "previous": null, "last": ";page=1&per_page=2000&ref=last" } }
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742393861a4435547.html
评论列表(0条)