Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
This conversation has been locked due to inactivity. Please create a new post.
I want to write Junit for
Optional.map(pageResource -> pageResource.adaptTo(Page.class))
.map(Page::getTemplate)
But I am unable to mock these.
Solved! Go to Solution.
@Shaheena_Sheikh , very simple, you would need to add mock resources in the AEMContext. In particular you would want to create pages like:
context.pageManager().create("/content/sample/page1", "page1", "/apps/sample/templates/homepage", "page1");
And you would want to pass in resolver.resolve("/content/sample/page1");
View solution in original post
Views
Likes
Replies