Archives

Implementing Mocking for Apex Tests

Trying to mock a actual database query can be hard. Using the fflib_Mocks jar you can generator Selector Mocks: More info here: https://github.com/financialforcedev/fflib-apex-mocks 1. Create interface class that extends fflib_ISObjectSelector to mock the Selector  2. Create interfacemocks.properties file in root of your project 3. Run java -jar apex-mocks-generator-4.0.0.jar “{path}/src/classes” “{path}/interfacemocks.properties” “fflib_Mocks” “{path}/src/classes” “30.0” to generate mocking […]

Rate this:

Read More