Improving Unit Testing Using ApexMocks Framework

Improving Unit Testing Using ApexMocks Framework

ApexMocks framework
Traditional unit testing on the platform can be a time consuming business. For developers with an enterprise background in Java or C#, one of the things they may miss is something called a mocking framework. Unit tests for Apex are often what an enterprise developer might think of as more of an integration test – for the component being tested, they might need to setup a lot of data records, insert them into the database, make sure data for any dependent components is setup correctly… all of this takes time to both code and to execute when the test is run. With the FinancialForce ApexMocks framework (which is heavily based on mockito, a leading mocking framework for Java) developers are able to write true unit tests – focusing 100% on testing the logic of the component they are developing, with no need to worry about inserting data and such like. This frees developers up to hopefully be far more productive and also creates the possibility of a full suite of unit tests being run very quickly, maybe every time someone commits to source control or your continuous integration server runs a new build. Source code can be found hereĀ Please see for full details and documentation.

Receive updates


Grow your business with a customer-centric ERP solution.


The CFO Guide
to Revenue Recognition

Concerned about the transition to the new revenue recognition standards?


See the #1 ERP
on Salesforce

Schedule time with a Cloud ERP specialist to chat about your needs.


Let’s talk: 1-866-743-2220