You need to sign in to do that
Don't have an account?
Christian Carvajal 9
@isTest(SeeAllData=true)
I have test classes that have been built using the @IsTest(SeeAllData=true) however, to my understanding it's not the best practice. Do I need to rewrite new test.classes using @IsTest(SeeAllData=false) or can I just replace the original code and then redeploying via a force.com tool?
Please remove the SeeAllData = true from the @isTest create one setup method using @Testsetup annotation and insert all the needed data in that method. Now create your method with @isTest annotation and query the data you will get the data inserted in setup method.
Like below code If it works for you then select as best answer
Thanks
All Answers
Please remove the SeeAllData = true from the @isTest create one setup method using @Testsetup annotation and insert all the needed data in that method. Now create your method with @isTest annotation and query the data you will get the data inserted in setup method.
Like below code If it works for you then select as best answer
Thanks