Activity Forums Salesforce® Discussions Problem in batch class in salesforce

  • Problem in batch class in salesforce

    Posted by Deepak on September 20, 2019 at 1:28 pm

    I am writing a test class of batch class it code coverage is 80% but my execute part is not covered. Is it necessary to cover execute part?

    Nikita replied 5 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Nikita

    Member
    September 23, 2019 at 6:48 am

     

    Hi Deepak,

    Yes, it is necessary to cover the execute method of a batch class in the test class. If start is returning a batch ( which is rows returned by the query locator) then only it will go in the execute method.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos