Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

tomp10987048
Community profile tomp10987048 Level 1
Job title here
Location here
1 BADGE
Level 1

Level 1

Learn more
Joined the community 09-08-2019 6:30:55 AM
Offline
Top badges earned by tomp10987048
Customize the badges you want to showcase on your profile
Re: AEM Mocks - mock context's resources null after first test
Avatar
Validate 1
Level 1
tomp10987048
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
tomp10987048
- Adobe Experience Manager
Thank you! I was told by the compiler that I needed a test instance lifecycle declared, but after deleting it, it is running as intended. Thank again

Views

976

Likes

0

Replies

0
Re: AEM Mocks - mock context's resources null after first test
Avatar
Validate 1
Level 1
tomp10987048
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
tomp10987048
- Adobe Experience Manager
I've also tried getting the resources through the resource resolver from the context with the same results:The context seems to lose all of the json after one method.Resource resource = resourceResolver.getResource("/content/en/eventPage1");Page eventPage1 = resource.adaptTo(Page.class);

Views

931

Likes

0

Replies

0
AEM Mocks - mock context's resources null after first test
Avatar
Validate 1
Level 1
tomp10987048
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
tomp10987048
- Adobe Experience Manager
Hello,I'm new to AEM and AEM Mocks, and trying to implement unit testing in a small AEM 6.5 project. However I'm having issues with the AemContext.I have 3 test cases to test an OSGi service, the service itself is basically a POJO that takes a page (com.day.cq.wcm.api.Page) as a parameter. My problem is that only the first test case that executes can retrieve pages from the mock context. The other two test cases, even when using the exact same method of grabbing pages, result in a NullPointerExc...

Views

1.7K

Likes

0

Replies

3