Activity Forums Salesforce® Discussions What is @testSetup in Salesforce?

  • Deepak

    Member
    May 7, 2020 at 12:27 pm

    Methods defined with the @testSetup annotation are used for creating common test records that are available for all test methods in the class.

  • Aditya

    Member
    May 7, 2020 at 2:42 pm

    Hi,
    @testSetup is used for considering the common methods

  • Shweta

    Member
    May 7, 2020 at 2:46 pm

    @testSetup: You can write a method in the test class, with @TestSetUp annotation applied, and create all your common test data in this method. Data created in this method doesn’t need to be created again and again, and it is by default available for all test methods.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos