What is a consideration when testing batch Apex? - ProProfs Discuss
Topics-
Products +
     

What is a consideration when testing batch Apex?



A. Test methods Must execute the batch with a scope size of less than 200 records.
B. Test methods Must call the batch execute () method once
C. Test methods Must use the @isTest (SeeAllData=true) annotation.
D. Test methods Must run the batch between Test. startTest () and Test.stopTest

This question is part of PD2
Asked by Pal, Last updated: Sep 10, 2018

+ AnswerRequest Answer
...

4 Answers

zhengtianbing

Zhengtianbing

Answered on Jul 26, 2019

Https://trailhead.salesforce.com/en/content/learn/modules/asynchronous_apex/async_apex_batch

tha answer is A and D.

 Reply

ugurkaya

Ugurkaya

Answered on Jul 23, 2019

Answers is A and D.

As written on trailhead batch apex unit:

Make sure that the number of records inserted is less than the batch size of 200 because test methods can execute only one batch total.

 Reply

J. Shatner

J. ShatnerContent writer, Boston
Content writer, Boston

Answered on Sep 10, 2018

The consideration is letter B. Batch APEX is actually very important. This is something used in order to build processes that can be used for thousands of records when used on the lightning platform. Knowing this, it is evident why A is not the right answer.

Batch APEX is able to go through not just hundreds but thousands of needed processes. This can cover all of your recordsets and it will be able to break down these thousands of records to chunks that you will find more manageable. This means that you will know

 Reply

Pal

Pal

Answered on Nov 20, 2017

Test methods must call the batch execute () method once
Test methods must run the batch between Test. startTest () and Test.stopTest
 Reply

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.