fflib Apex Mocks
By Andrew Fawcett / FinancialForce
What It Does
Mocking framework for Apex unit tests. Mock selectors, services, and domain classes to write fast, isolated tests without hitting the database.
Glen's Take
Pairs with fflib-apex-common to enable real unit testing in Apex. Instead of inserting 50 records to test a trigger, mock the selector and test your logic in isolation. Tests run in milliseconds instead of seconds. The syntax takes getting used to, but it's worth it.
Tags
Need help with your Salesforce tooling stack?
I'll help you pick and configure the right tools for your team.
View Consulting →Enjoyed this? Get more like it.
Glen's Musings — AI, investing, and building things. Occasional. Free.
More Library Tools
fflib Apex Common (Enterprise Patterns)
Apex enterprise design patterns — Unit of Work, Selector, Domain, and Service layers. The foundation for scalable Salesforce architecture.
Read moreOpen SourceNebula Logger
Enterprise-grade logging framework for Salesforce. Custom logging levels, log entry tagging, automatic stack traces, and a beautiful log viewer UI.
Read moreOpen SourceApex Trigger Actions Framework
Metadata-driven trigger framework. Define trigger actions in custom metadata instead of code. Supports ordering, bypassing, and recursive protection.
Read more