Testing, Debugging, and Deployment Flashcards

1
Q

A third-party API endpoint that is designed to return posts from a certain platform was introduced to the developer team of a digital marketing company. The senior developer would like to quickly evaluate the API first by performing test callouts to an endpoint and examining returned responses.

What is a suitable option to complete this task?

A. Execute anonymous block
B. Create an outbound message
C. Write a unit test for the callout
D. Use Workbench REST explorer

A

A. Execute anonymous block

An anonymous block is the most suitable option for quickly evaluating Apex code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A developer of Cosmic Solutions has updated an important process in a sandbox environment. He needs to push it to the company’s production org as an active process using a change set.

Which of the following should be considered when deploying an active process via a change set?

Choose 2

A. At least 75% of active processes and autolaunched flows must be covered by Apex tests
B. A process cannot be deployed as active if it calls an Apex method.
C. ‘Deploy processes and flows as active’ must be enabled in setup
D. An active process in the source org will be deployed as inactive in the destination org

A

A. At least 75% of active processes and autolaunched flows must be covered by Apex tests

C. ‘Deploy processes and flows as active’ must be enabled in setup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following can be used to execute specific Apex test methods in an organization?

Choose 3

A. Data Loader
B. Visual Studio Code
C. SOAP API
D. Change Sets
E. Developer Console
A

B. Visual Studio Code

C. SOAP API

E. Developer Console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following statements about triggers are true?

Choose 3

A. A developer can specify the version of Apex and API which can be used with the Trigger
B. Trigger code is stored as metadata under the object which they are associated with.
C. Apex Triggers are always active and cannot be turned off.
D. Triggers can be used to detect a before undelete event
E. For the Attachment, ContentDocument and Note standard objects, a trigger cannot be created in the Salesforce user interface

A

A. A developer can specify the version of Apex and API which can be used with the Trigger

B. Trigger code is stored as metadata under the object which they are associated with.

E. For the Attachment, ContentDocument and Note standard objects, a trigger cannot be created in the Salesforce user interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can Apex triggers be activated and deactivated?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When would a full copy sandbox be required?

Choose 2

A. Performance and Load Testing
B. Staging
C. Training
D. Integration Testing

A

A. Performance and Load Testing

B. Staging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Developer Sandbox intended for?

A

A Developer sandbox is intended for development and testing in an isolated environment. A Developer Sandbox includes a copy of your production org’s configuration (metadata).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Developer Pro Sandbox intended for?

A

A Developer Pro sandbox is intended for development and testing in an isolated environment and can host larger data sets than a Developer sandbox. A Developer Pro sandbox includes a copy of your production org’s configuration (metadata). Use a Developer Pro sandbox to handle more development and quality assurance tasks and for integration testing or user training.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Partial Copy Sandbox intended for?

A

Intended to be used as a testing environment. Use a partial copy for QA, UAT, Integration testing and training

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Full Sandbox intended for?

A

Performance testing, load testing, and staging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which type of sandbox is a full replication of your production org

A

Full Sandbox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the procedure for unit testing?

A. Create test data, call the method being tested, verify results, delete an records created
B. Create test data, call the method being tested, verify results
C. Create test data, run all tests, verify results, delete any records created
D. Create test data, run all tests, delete any records created, and verify results

A

B. Create test data, call the method being tested, verify results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why don’t you have to go back and delete test data?

A

Because the data is never committed, so it doesn’t need to be deleted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which are true regarding the runAs() method?

Choose 2

A. runAs() ignores user license limits
B. runAs() enforces user permissions and field level permissions
C. runAs() can be used with existing users or a new user
D. runAs() can be used in any Apex method

A

A. runAs() ignores user license limits

C. runAs() can be used with existing users or a new user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or False

the runAs() method enforces user permissions or field level permissions

A

False

it only enforces record sharing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the runAs() method enable you to do?

A

Run tests methods that change the user context to an existing user or a new user so that the user’s record sharing is enforced

17
Q

When can you use runAs()?

A

Only in testing methods

18
Q

Can you nest runAs() statements?

A

Yes

19
Q

Can you use the runAs() method to perform mixed DML operations in your test by enclosing DML operations within the runAs block?

A

True