Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Platform Developer II Topic 4 Question 108 Discussion

Actual exam question for Salesforce's Platform Developer II exam
Question #: 108
Topic #: 4
[All Platform Developer II Questions]

A developer created 2 class that implements the Queueable Interface, as follows:

As part of the deployment process, the developer is asked to create a corresponding test class.

Which two actions should the developer take to successfully execute the test class?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: B, C

Contribute your Thoughts:

Derick
6 days ago
I'd also add the Test.isRunningTest() check to make sure we don't accidentally chain jobs during the test execution. Gotta keep it clean and focused.
upvoted 0 times
...
Arlette
11 days ago
Haha, 'seeAllData=True'? Really? That's like asking the test to see into the future or something. Not a good idea!
upvoted 0 times
...
Pete
12 days ago
Definitely, we'll also need to ensure the running user has the 'View All' permission on the Order object. That's crucial for the test to pass.
upvoted 0 times
Walton
21 hours ago
A) Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.
upvoted 0 times
...
...
Xuan
22 days ago
But we also need to implement Test.isRunningTest() to prevent chaining jobs during test execution.
upvoted 0 times
...
Dudley
1 months ago
I agree with Mireya. That's important for testing Queueable jobs.
upvoted 0 times
...
Audria
1 months ago
I think we need to enclose the job execution in Test.startTest() and Test.stopTest() to ensure the job runs in isolation during the test.
upvoted 0 times
Celestina
28 days ago
D) Implement Test.isRunningTest() to prevent chaining jobs during test execution.
upvoted 0 times
...
Karon
1 months ago
C) Enclose System.enqueueJob(new OrderQueueableJob ()) within Test.startTest() and Test.stopTest().
upvoted 0 times
...
Tamera
1 months ago
B) Ensure the running user of the test class has, at I the View All permission on the Order object.
upvoted 0 times
...
...
Mireya
1 months ago
I think we need to enclose System.enqueueJob within Test.startTest and Test.stopTest.
upvoted 0 times
...

Save Cancel