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
Jamal
1 day ago
Not sure if changing to SlingContext is the best move.
upvoted 0 times
...
Maurine
7 days ago
Surprised that @Rule annotation isn't the first choice here!
upvoted 0 times
...
Francine
12 days ago
Wait, why would you replace AemContext? That seems off.
upvoted 0 times
...
Isidra
17 days ago
I agree, without that, the test won't work properly.
upvoted 0 times
...
Arlette
22 days ago
I think option C is definitely needed to load the node data.
upvoted 0 times
...
Edna
27 days 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
1 month 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
1 month 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
1 month 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