Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
Hi All,
I have a similar issue as described in this link http://stackoverflow.com/questions/31672975/null-pointer-exception-while-creating-junit-testcases-fo... , Any Solution for this?
Thanks in Advance.
Solved! Go to Solution.
Thanks for the Reply. I figured out a way, this worked for me.
@CascadingWCMUse wcmUse;
wcmUse.getResource().adaptTo(Node.class);
or
@MockedWCMUse wcmUse;
wcmUse.getResource();
Thanks!
View solution in original post
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(); }
Views
Likes
Replies