Skip to content

Migration Guide v3.0.0

GitHub Action edited this page Nov 11, 2025 · 6 revisions

Starting in v3.0.0, several deprecated methods and objects will be removed. These breaking changes will require planning and forethought to implement, if these deprecated artifacts are used in your codebase.

Migration Steps

Follow these steps to succesfully migrate your package to v3.0.0:

1. Install v2.5.1

This is the latest version of the package before v3.0.0. It contains both the deprecated artifacts, and their replacements, making it suitable for migration.

You can find instructions to install this package here.

2. Replace all references to the following methods:

Class Old Method New Method
MockDml clearFailures shouldSucceed
MockDml fail shouldFail
MockDml failIf shouldFailIf
MockDml.History eraseHistory MockDml.eraseAllHistories
MockDml.RecordHistory getRecord MockDml.get
Soql bind addBind
Soql defineAccess setAccessLevel
Soql fromSObject setFrom
Soql groupBy addGroupBy
Soql orderBy addOrderBy
Soql usingScope setScope

3. Add Dml.Operation Method to MockDml.ConditionalFailure:

The Dml.Operation enum replaces the MockDml.Operation. These enums have identical values.

Prior to v3.0.0, the MockDml.ConditionalFailure's interface method references the old enum:

public class MyImplementation implements MockDml.ConditionalFailure {
	public Exception checkFailure(MockDml.Operation operation, SObject record) {
		// Your implementaiton here!
	}
}

In v3.0.0, the MockDml.ConditionalFailure interface references the new enum. The old enum is removed in v3.1.0 and later versions.

Therefore, you will need to (temporarily) create a duplicate method in your implementation, that is identical to the existing method, aside from the enum type that is used:

public class MyImplementation implements MockDml.ConditionalFailure {
	public Exception checkFailure(MockDml.Operation operation, SObject record) {
		// Old implementation, can be unchanged (for now)
	}

	public Exception checkFailure(Dml.Operation operation, SObject record) {
		// Duplicate the old implementation, `operation` type aside:
	}
}

4. Install v3.0.0

v3.0.0 removes most of the deprecated artifacts, with the exception of MockDml.Operation. Install this package here:

You can find instructions to install this package here.

5. Remove MockDml.Operation from MockDml.ConditionalFailure

Now that v3.0.0 has been installed, you can safely remove the old MockDml.Operation method from your MockDml.ConditionalFailure implementation:

public class MyImplementation implements MockDml.ConditionalFailure {
	public Exception checkFailure(Dml.Operation operation, SObject record) {
		// Your implementation here
	}
}

🎉 Congrats! If you made it this far, your installation has been successfully upgraded.

apex-database-layer

Home

Core Concepts

Reference Guide

Migration Gudes

Clone this wiki locally