Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
CQ_learnerAccepted solution
Level 3
Jun 21, 2016 7:59 AM UTC

Thanks for the Reply. I figured out a way, this worked for me.

@Cascading
WCMUse wcmUse;

wcmUse.getResource().adaptTo(Node.class);

 

or 

@Mocked
WCMUse wcmUse;

wcmUse.getResource();

 

Thanks!

2 replies

Tuhin_Ghosh
Level 8
Jun 21, 2016 7:19 AM UTC

Try acquiring the resourceResolver object like the below example and try once

@Rulepublic final AemContext context = new AemContext();@Testpublic void testSomething() { ResourceResolver resourceResolver = context.resourceResolver(); }
Translate
CQ_learnerAuthorAccepted solution
Level 3
Jun 21, 2016 7:59 AM UTC

Thanks for the Reply. I figured out a way, this worked for me.

@Cascading
WCMUse wcmUse;

wcmUse.getResource().adaptTo(Node.class);

 

or 

@Mocked
WCMUse wcmUse;

wcmUse.getResource();

 

Thanks!

Translate