Skip to content

Instantly share code, notes, and snippets.

View tet3's full-sized avatar

Thomas Taylor tet3

  • Philadelphia, PA
  • X @tet3
View GitHub Profile
-------------------------------------------------
nench.sh v2019.07.20 -- https://git.io/nench.sh
benchmark timestamp: 2020-05-02 19:42:08 UTC
-------------------------------------------------
Processor: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz
CPU cores: 3
Frequency: 2899.996 MHz
RAM: 3.9G
Swap: 4.0G
@tet3
tet3 / HttpMockRegistry.cls
Created July 29, 2022 18:03 — forked from PezzerDev/HttpMockRegistry.cls
[More Robust Mocking in Apex] A dynamic HTTP mock registry and a configurable Stub class to simplify and enhance mocking for Apex unit tests #salesforce #apex
/**
* A registry built around the Salesforce Mocking API that allows declarative mocking of HTTP callouts. Mocks responses
* can be registered either for a specific endpoint and path or for all paths on an endpoint, with the former taking
* precedence.
*/
@IsTest
public class HttpMockRegistry {
// Default mock response for HTTP requests
public static final HttpResponse DEFAULT_MOCK_RESPONSE = createSuccessResponse('Default mock response');