Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam CRT-450 Topic 6 Question 61 Discussion

Actual exam question for Salesforce's CRT-450 exam
Question #: 61
Topic #: 6
[All CRT-450 Questions]

A developer created this Apex trigger that calls Myclass.myStaticMethod:

The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, 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?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Nana
2 months ago
I'm going with D. The trigger has no coverage, so the deployment is going to fail. Gotta make sure everything is properly tested, you know?
upvoted 0 times
...
Clorinda
2 months ago
Haha, I love how the developer just decided to test the static method directly. That's a classic move, but it's not going to fly with the deployment requirements.
upvoted 0 times
Wilda
1 months ago
User3: The test class needs to actually test the trigger, not just the static method.
upvoted 0 times
...
Pa
1 months ago
The trigger won't deploy with just 81% code coverage.
upvoted 0 times
...
Queenie
1 months ago
Yeah, testing the static method directly won't cut it for deployment.
upvoted 0 times
...
...
Carey
2 months ago
Hmm, I'm not sure about that. Isn't it a requirement to have coverage for every Apex class and trigger that's being deployed? D seems more likely to be the correct answer.
upvoted 0 times
Sharita
1 months ago
You're correct, having coverage for every class and trigger is a requirement for deployment.
upvoted 0 times
...
Gail
1 months ago
But what about option A? It mentions that the trigger will not deploy.
upvoted 0 times
...
Erin
1 months ago
I believe option D is correct because the test method directly calls the static method.
upvoted 0 times
...
Gracia
1 months ago
I think you're right, D does seem like the correct answer.
upvoted 0 times
...
...
Lavonne
2 months ago
But doesn't the trigger also contribute to the overall code coverage?
upvoted 0 times
...
Florinda
3 months ago
I believe the deployment will fail because no assertions were made in the test method.
upvoted 0 times
...
Harrison
3 months ago
I think the answer is C. As long as the overall code coverage is above 75%, the deployment should pass, even if the trigger itself has no coverage.
upvoted 0 times
Rosita
1 months ago
That makes sense. So the deployment should pass in this case.
upvoted 0 times
...
Brett
1 months ago
It shouldn't matter as long as the overall code coverage is above 75%.
upvoted 0 times
...
Nancey
2 months ago
But what if the trigger itself has no code coverage?
upvoted 0 times
...
Juliann
2 months ago
I agree, option C seems to be the correct answer.
upvoted 0 times
...
...
Lavonne
3 months ago
I think the deployment will pass because the code has 81% coverage.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77