Activity Forums Salesforce® Discussions What is the benefit of using @isTestSetup instead of @isTest in Salesforce

  • What is the benefit of using @isTestSetup instead of @isTest in Salesforce

    Posted by Aditya on July 16, 2020 at 3:20 PM

    What is the benefit of using @isTestSetup instead of @isTest in Salesforce Testing?

    Pooja replied 5 years, 10 months ago 4 Members · 3 Replies
  • 3 Replies
  • Kirandeep

    Member
    July 16, 2020 at 3:48 PM

    @testSetup annotation are used for creating common test records that are available for all test methods in the class. main benefit is code reusablility.

  • [adinserter block='9']
  • Marziya

    Member
    July 16, 2020 at 3:55 PM

    For Apex code saved using Salesforce API version 24.0 and later, use the @isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization. … The @isTest(SeeAllData=true) annotation is used to open up data access when applied at the class or method level.

  • Pooja

    Member
    July 16, 2020 at 7:00 PM

    @testSetup annotation are used for creating common test records that are available for all test methods in the class. main benefit is code reusablility.

Log In to reply.