A developer used custom settings to store some configuration data that changes occasionally. However, tests are now Failing in some of the sandboxes that were recently refreshed.
What should be done to eliminate this issue going forward?
A.
Set the setting type on the custom setting to List.
B.
Replace custom settings with static resources.
C.
Set the setting type on the custom setting to Hierarchy.
Replacing custom settings with custom metadata types is a good solution to ensure that test data is consistent across environments. Custom metadata types are deployable, and their records are available in test methods by default, unlike List Custom Settings which need to be manually recreated in each environment after a refresh.
[References: Salesforce Help - Custom Metadata Types Overview]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit