Skip to content

Instantly share code, notes, and snippets.

/limitsMock Secret

Created Dec 18, 2017
Embed
What would you like to do?
@isTest
global with sharing class limitsMock implements HTTPCalloutMock{
global HTTPResponse respond(HTTPRequest req){
HttpResponse res = new HTTPResponse();
res.setHeader('Content-Type', 'application/JSON');
res.setBody('{ "ConcurrentAsyncGetReportInstances" : { "Max" : 200, "Remaining" : 200 }, "ConcurrentSyncReportRuns" : { "Max" : 20, "Remaining" : 20 }, "DailyApiRequests" : { "Max" : 6450000, "Remaining" : 4988570, "Ant Migration Tool" : { "Max" : 0, "Remaining" : 0 }, "Chatter Desktop" : { "Max" : 0, "Remaining" : 0 }, "Chatter Mobile for BlackBerry" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Bulk" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Partner" : { "Max" : 0, "Remaining" : 0 }, "Force.com IDE" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Chatter" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Files" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Mobile Dashboards" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Touch" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Android" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Outlook" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for iOS" : { "Max" : 0, "Remaining" : 0 }, "SalesforceA" : { "Max" : 0, "Remaining" : 0 }, "Workbench" : { "Max" : 0, "Remaining" : 0 }, "inContact Integration" : { "Max" : 0, "Remaining" : 0 } }, "DailyAsyncApexExecutions" : { "Max" : 350000, "Remaining" : 342356 }, "DailyBulkApiRequests" : { "Max" : 10000, "Remaining" : 9954, "Ant Migration Tool" : { "Max" : 0, "Remaining" : 0 }, "Chatter Desktop" : { "Max" : 0, "Remaining" : 0 }, "Chatter Mobile for BlackBerry" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Bulk" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Partner" : { "Max" : 0, "Remaining" : 0 }, "Force.com IDE" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Chatter" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Files" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Mobile Dashboards" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Touch" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Android" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Outlook" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for iOS" : { "Max" : 0, "Remaining" : 0 }, "SalesforceA" : { "Max" : 0, "Remaining" : 0 }, "Workbench" : { "Max" : 0, "Remaining" : 0 }, "inContact Integration" : { "Max" : 0, "Remaining" : 0 } }, "DailyDurableGenericStreamingApiEvents" : { "Max" : 1000000, "Remaining" : 1000000 }, "DailyDurableStreamingApiEvents" : { "Max" : 1000000, "Remaining" : 1000000 }, "DailyGenericStreamingApiEvents" : { "Max" : 10000, "Remaining" : 10000, "Ant Migration Tool" : { "Max" : 0, "Remaining" : 0 }, "Chatter Desktop" : { "Max" : 0, "Remaining" : 0 }, "Chatter Mobile for BlackBerry" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Bulk" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Partner" : { "Max" : 0, "Remaining" : 0 }, "Force.com IDE" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Chatter" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Files" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Mobile Dashboards" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Touch" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Android" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Outlook" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for iOS" : { "Max" : 0, "Remaining" : 0 }, "SalesforceA" : { "Max" : 0, "Remaining" : 0 }, "Workbench" : { "Max" : 0, "Remaining" : 0 }, "inContact Integration" : { "Max" : 0, "Remaining" : 0 } }, "DailyStreamingApiEvents" : { "Max" : 1000000, "Remaining" : 999747, "Ant Migration Tool" : { "Max" : 0, "Remaining" : 0 }, "Chatter Desktop" : { "Max" : 0, "Remaining" : 0 }, "Chatter Mobile for BlackBerry" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Bulk" : { "Max" : 0, "Remaining" : 0 }, "Dataloader Partner" : { "Max" : 0, "Remaining" : 0 }, "Force.com IDE" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Chatter" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Files" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Mobile Dashboards" : { "Max" : 0, "Remaining" : 0 }, "Salesforce Touch" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Android" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for Outlook" : { "Max" : 0, "Remaining" : 0 }, "Salesforce for iOS" : { "Max" : 0, "Remaining" : 0 }, "SalesforceA" : { "Max" : 0, "Remaining" : 0 }, "Workbench" : { "Max" : 0, "Remaining" : 0 }, "inContact Integration" : { "Max" : 0, "Remaining" : 0 } }, "DailyWorkflowEmails" : { "Max" : 487000, "Remaining" : 473334 }, "DataStorageMB" : { "Max" : 323422, "Remaining" : 253722 }, "DurableStreamingApiConcurrentClients" : { "Max" : 2000, "Remaining" : 1999 }, "FileStorageMB" : { "Max" : 1107627, "Remaining" : 677213 }, "HourlyAsyncReportRuns" : { "Max" : 1200, "Remaining" : 1200 }, "HourlyDashboardRefreshes" : { "Max" : 200, "Remaining" : 200 }, "HourlyDashboardResults" : { "Max" : 5000, "Remaining" : 5000 }, "HourlyDashboardStatuses" : { "Max" : 999999999, "Remaining" : 999999999 }, "HourlyODataCallout" : { "Max" : 20000, "Remaining" : 18181 }, "HourlySyncReportRuns" : { "Max" : 500, "Remaining" : 500 }, "HourlyTimeBasedWorkflow" : { "Max" : 3000, "Remaining" : 3000 }, "MassEmail" : { "Max" : 5000, "Remaining" : 5000 }, "PermissionSets" : { "Max" : 1500, "Remaining" : 1443, "CreateCustom" : { "Max" : 1000, "Remaining" : 954 } }, "SingleEmail" : { "Max" : 5000, "Remaining" : 4988 }, "StreamingApiConcurrentClients" : { "Max" : 2000, "Remaining" : 2000 } }');
res.setStatusCode(200);
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment