Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E137 Exam - Topic 4 Question 18 Discussion

A developer has created a new Sling Model called Flarp. The developer wants to create a unit test for this Sling Model.What needs to be changed for the unit test to successfully test the getName method of the Flarp Sling Model?
A) Replace AemContext with SlingContext with ResourceResolverType of JCR_OAK.
B) Add an @Rule annotation before the line private final AemContext ctx = new AemContext();
C) Add a ctx.load().json() method call to get the node data.

Adobe AD0-E137 Exam - Topic 4 Question 18 Discussion

Actual exam question for Adobe's AD0-E137 exam
Question #: 18
Topic #: 4
[All AD0-E137 Questions]

A developer has created a new Sling Model called Flarp. The developer wants to create a unit test for this Sling Model.

What needs to be changed for the unit test to successfully test the getName method of the Flarp Sling Model?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Edna
12 hours ago
I definitely remember that we need to load some data for the test, so option C seems like the right choice to me.
upvoted 0 times
...
Jacqueline
6 days ago
I feel like replacing AemContext with SlingContext could be a valid option, but I can't recall the specifics of when to do that.
upvoted 0 times
...
Kristin
11 days ago
I'm not entirely sure, but I remember something about using @Rule annotations in unit tests. Maybe that's relevant here?
upvoted 0 times
...
Stefan
16 days ago
I think we might need to add a ctx.load().json() method call to set up the test data properly. That sounds familiar from our practice questions.
upvoted 0 times
...

Save Cancel