Skip to main content
Level 3
Jan 26, 2025 7:10 AM UTC
Solved

AEM Developer Certification Question - AEM Unit Testing

An AEM application msut implement user testing using AEM Mocks.
Which two service does the Class AemContext provide developers access to? (Choose two)

A. Session

B. FlushAgent

C. TagManager

D.WorkflowSession

E. ModelFactory
Tethich
TethichAccepted solution
Community Advisor
Jan 26, 2025 10:48 AM UTC

Hi @s__k__agarwal 

 

I would say TagManager and ModelFactory:

Provides various common required mock objects and helpers such as SlingHttpServletRequest objects, various mock Sling and AEM OSGi services such as ModelFactory, PageManager, Page, Template, ComponentManager, Component, TagManager, Tag, etc.

 

Source: https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/unit-testing

3 replies

Tethich
Community Advisor
TethichCommunity AdvisorAccepted solution
Community Advisor
Jan 26, 2025 10:48 AM UTC

Hi @s__k__agarwal 

 

I would say TagManager and ModelFactory:

Provides various common required mock objects and helpers such as SlingHttpServletRequest objects, various mock Sling and AEM OSGi services such as ModelFactory, PageManager, Page, Template, ComponentManager, Component, TagManager, Tag, etc.

 

Source: https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/unit-testing

Translate
Raja_Reddy
Community Advisor
Community Advisor
Jan 27, 2025 5:51 AM UTC

Hi @s__k__agarwal 

AEM Mocks provides developers access to the following services:

  1. TagManager (Option C)
  2. ModelFactory (Option E)
Translate
AmitVishwakarma
Community Advisor
Community Advisor
Feb 2, 2025 7:37 AM UTC

The two services that the AemContext class provides developers access to are:
1. TagManager (C)

2. ModelFactory (E)
These services are commonly used for unit testing in AEM, providing mock objects and helpers like SlingHttpServletRequest, ModelFactory, and TagManager.

Translate
Amit Vishwakarma - Adobe Commerce Champion 2025 | 17x Adobe certified | 6x Adobe SME