I'm a little confused about the difference between AemContext and SlingContext. I'll need to review my notes on Sling testing to make sure I understand which one is more appropriate for this scenario.
Okay, I think the key here is that the unit test needs to load the node data before it can test the getName method. So I'd go with option C and add the ctx.load().json() call.
Hmm, this looks tricky. I'm not sure if I should replace the AemContext with SlingContext or just add the @Rule annotation. I'll need to do some more research on the different context types and how they're used in unit testing.
I think I'd start by looking at the code for the Flarp Sling Model and understanding what it's doing. Then I'd try to figure out what the unit test needs to do to properly test the getName method.
upvoted 0 times
...
Log in to Pass4Success
Sign in:
Report Comment
Is the comment made by USERNAME spam or abusive?
Commenting
In order to participate in the comments you need to be logged-in.
You can sign-up or
login
Harris
1 day agoPedro
6 days agoGladis
12 days agoLavonda
17 days agoAnnette
22 days agoLorita
27 days agoTom
1 month agoEura
1 month agoClaudia
1 month agoJudy
2 months agoCeola
2 months agoRosalind
2 months agoQueen
2 months agoLettie
2 months agoSuzi
2 months agoDante
3 months agoNakisha
3 months agoJovita
3 months agoBong
3 months ago