Valid PDI Dumps shared by ExamDiscuss.com for Helping Passing PDI Exam! ExamDiscuss.com now offer the newest PDI exam dumps, the ExamDiscuss.com PDI exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDI dumps with Test Engine here:
A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required." What should the developer do to successfully deploy the new Apex trigger and helper class?
Correct Answer: A
When deploying Apex code to production, Salesforce requires that all Apex triggers have at least 1% code coverage and the overall code coverage must be at least 75%. In this scenario: The developer has a test class that covers 95% of the helper class. The deployment fails because the trigger has 0% coverage. The error message indicates that the trigger needs at least 1% coverage. Solution: Option A: Create a test class and methods to cover the Apex trigger. Correct Action. Write a test class that specifically tests the trigger's functionality. Ensure that the trigger is executed within the test context. This will increase the trigger's code coverage above the required 1%. The helper class already has 95% coverage. Increasing coverage on the helper class does not affect the trigger's coverage. Option C: Remove the failing test methods from the test class. Incorrect. Removing test methods could reduce overall code coverage. Does not address the issue of the trigger's coverage. Option D: Run the tests using the 'Run All Tests' method. Ineffective. Running all tests does not change the fact that the trigger has 0% coverage. The trigger must be covered by a test method. Conclusion: To successfully deploy the new Apex trigger and helper class, the developer should create a test class and methods that cover the Apex trigger, which is Option A. Reference: Writing Test Methods for Triggers Deployment Requirements Incorrect Options: Option B: Increase the test class coverage on the helper class. Ineffective.