-
Notifications
You must be signed in to change notification settings - Fork 0
Migration Guide v3.0.0
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.
Follow these steps to succesfully migrate your package to v3.0.0:
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.
| Class | Old Method | New Method |
|---|---|---|
MockDml |
clearFailures |
shouldSucceed |
MockDml |
fail |
shouldFail |
MockDml |
failIf |
shouldFailIf |
|
eraseHistory |
MockDml.eraseAllHistories |
|
getRecord |
MockDml.get |
|
bind |
addBind |
|
defineAccess |
setAccessLevel |
|
fromSObject |
setFrom |
|
groupBy |
addGroupBy |
|
orderBy |
addOrderBy |
|
usingScope |
setScope |
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:
}
}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.
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.
- Generating Test Records
- Dml
- Soql
- Cmdt
- Duplicates
- Plugins
- DatabaseLayer
- Dml
- MockDml
- MockRecord
- Cmdt
- MockCmdt
- Duplicates
- MockDuplicates
- MockSoql
-
Soql
- Soql.AggregateResult
- Soql.Aggregation
- Soql.Binder
- Soql.Builder
- Soql.Condition
- Soql.ConditionalLogic
- Soql.Criteria
- Soql.Cursor
- Soql.Function
- Soql.InnerQuery
- Soql.InvalidParameterValueException
- Soql.LogicType
- Soql.NullOrder
- Soql.Operation
- Soql.Operator
- Soql.ParentField
- Soql.PreAndPostProcessor
- Soql.QueryLocator
- Soql.Request
- Soql.Scope
- Soql.Selectable
- Soql.SortDirection
- Soql.SortOrder
- Soql.Subquery
- Soql.TypeOf
- Soql.Usage
- Soql.WhenClause