Which three considerations should be made when using the runAs() - ProProfs Discuss
Advertisement

Which three considerations should be made when using the runAs() method to design apex unit tests?

UC has a strict security model enforced through object, field, and row-based security mechanisms. The architect would like to ensure the security model is being thoroughly tested using apex automates tests.

This question is part of sharing and visibility architect
Asked by Maxxpower, Last updated: Aug 27, 2020

+ Answer
Request
Question menu
Vote up 1 Vote down

4 Answers

Pritam

Pritam

Pritam
Pritam , Sr. Salesforce Consultant, Dubai

Answered Feb 19, 2020

A. runAS can be used inside of test classes to validate record-level security.
B. runAs does not enforce user permissions or field-level permissions in test classes.

upvote 1 downvote
Reply 

Gabriel

Gabriel

Gabriel
Gabriel

Answered Mar 02, 2020

A. runAS can be used inside of test classes to validate record-level security.
B. runAs does not enforce user permissions or field-level permissions in test classes.

upvote downvote
Reply 

mitesh0609

mitesh

mitesh0609
Mitesh

Answered Feb 09, 2020

The correct answers are as follows:

A. runAs can be used inside of the classes to validate Field level permissions.
B. runAS can be used inside of test classes to validate record level security.

upvote downvote 1
Reply 

maxxpower992

maxxpower

maxxpower992
Maxxpower

Answered Jan 15, 2020

RunAs can be used inside of the classes to validate Field level permissions
runAS can be used inside of test classes to validate record level security
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

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