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 4 years, 5 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.

  • 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.

Popular Salesforce Blogs

Popular Salesforce Videos