Quiz #2

Published in Quizzes

1. Which types of sandboxes clone production Documents during the refresh process?

  1. Developer Sandbox
  2. Developer Pro Sandbox
  3. Partial Sandbox
  4. Full Copy Sandbox
  5. Developer & Developer Pro Sandboxes
  6. Partial & Full Copy Sandboxes
  7. All sandbox types

Reveal answer


The Answer is D.

By-design both Developer and Developer-Pro Sandbox copies do not include documents during a sandbox copy whereas the Full version does. This behavior is considered working as designed since the Sandbox copy being used is a Developer licensed Sandbox which does not include documents during the Sandbox copy.

2. How to verify that custom permission is enabled in an apex code?

  1. System.UserInfo.hasPermission('MyCustomPermission')
  2. System.Permission.MyCustomPermission
  3. FeatureManagement.checkPermission('MyCustomPermission')
  4. Apex does not natively support Custom Permission

Reveal answer


The Answer is C. 

After Winter 18 Release you can use FeatureManagement class. This class has the method checkPermission(apiName) that checks whether a custom permission is enabled.

3. Unit tests are running slowly, what can do developer to speed up them? Choose two answers

  1. Use isParaller annotation
  2. Remove long processed unit tests
  3. Use TestSetup annotation to create test records
  4. Decrease the number of test records in the bulk tests

Reveal answer


The Answer is A, C.

Use Methods defined with the @testSetup annotation for creating common test records that are available for all test methods in the class. Records created in a test setup method are rolled back at the end of test class execution. By setting up records once for the class, you don’t need to recreate records for each test method. Also, because the rollback of records that are created during test setup happens at the end of the execution of the entire class, the number of records that are rolled back is reduced. As a result, system resources are used more efficiently compared to creating those records and having them rolled back for each test method.

Use the @isTest(isParallel=true) annotation to indicate test classes that can run in parallel and aren’t restricted by the default limits on the number of concurrent tests. This annotation makes the execution of test classes more efficient, because more tests can be run in parallel.

Comments powered by CComment