Salesforce Platform Developer I (legacy) — Question 103

A developer created this Apex trigger that calls MyClass.myStaticMethod: trigger myTrigger on Contact(before insert)
{ MyClass.myStaticMethod(trigger.new, trigger.oldMap); }
The developer creates a test class with a test method that calls MyClass.myStaticMethod, resulting in 81% overall code coverage.
What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?

Answer options

Correct answer: D

Explanation

The correct answer is D because the trigger itself must have code coverage for deployment, and the test method does not cover the trigger directly. While the overall code coverage is over 75%, it does not apply to the trigger since it is not tested, leading to a deployment failure.