SyncMadeEasy/force-app/main/default/classes/MockHttpResponseGenerator.cls

14 lines
669 B
OpenEdge ABL

@isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {
// Implement this interface method
global HTTPResponse respond(HTTPRequest req) {
// Create a fake response
HttpResponse res = new HttpResponse();
res.setHeader('Content-Type', 'application/json');
res.setBody('{ "inventory_items": [ { "id": 21681651843136, "sku": "phone 6", "created_at": "2019-01-08T23:13:17-12:00", "updated_at": "2019-01-09T01:00:08-12:00", "cost": "14000.00", "tracked": true, "admin_graphql_api_id": "gid://shopify/InventoryItem/21681651843136" } ] }');
res.setStatusCode(200);
return res;
}
}