AEM 6.1 | Sightly , JUnit for Class extending WCMuse | Community
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.
Best answer by CQ_learner

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

CQ_learnerAuthorAccepted solution
New Participant
June 21, 2016

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!

Tuhin_Ghosh
New Participant
June 21, 2016

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(); }