A developer is on an AEM application that is being used to calculate an employee's salary. The calculation is done in an OSGi service called CalculationService. This service class has a dependency on one other service, called the EmployeeService.
How should the developer make sure that the critical code in the CalculationService has a high unit test coverage?
A. Use a mock framework in the unit test to inject the CalculationService
B. Instantiate the EmployeeService in the unit test and pass it to the constructor of the CalculationService
C. Use a mock framework in the unit test to inject the EmployeeService
D. Use the feature flag in the unit test to disable the calls to the EmployeeService
Correct Answer: C
Explanation: A mock framework is a tool that allows creating mock objects that simulate the behavior of real objects in a controlled way. A mock framework can be used in a unit test to inject the EmployeeService dependency into the CalculationService and verify its interactions. This way, the unit test can focus on testing the logic of the CalculationService without relying on the actual implementation of the EmployeeService. References: https://sling.apache.org/documentation/development/sling-testing- tools.htmlhttps://wcm.io/testing/aem-mock/usage.html
Upon further inspection the developer notices that the link has no .html appended to the end of the URL
What could be a potential fix for the issue?
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: B
Explanation: Option B is a potential fix for the issue. Option B uses the data-sly-attribute block statement to add the href attribute to the anchor tag. The data-sly-attribute statement uses an expression to append ".html" to the item.path value.
This way, the link will have the correct extension and will resolve to the corresponding page.
AEM SPA integration provides various design models. In an application the developer chooses to use AEM as a headless CMS without using the SPA Editor SDK framework.
What would be an advantage for this design model?
A. The content author can edit the app using AEM's content authoring experience.
B. The developer has full control over the app.
C. The SPA is compatible with the template editor
D. The developer keeps control over the app by only enabling authoring in restricted areas of the app
Correct Answer: C
In an application where the developer chooses to use AEM as a headless CMS without using the SPA Editor SDK framework, the advantage would be that the developer keeps control over the app by only enabling authoring in restricted areas of the app. By limiting the use of the SPA Editor SDK, the developer can ensure that content authors do not have access to the entire application code and can only make changes within specific areas or components that have been designated for them. This provides greater security and control over the application while still allowing content authors to make necessary updates and changes to the content. Therefore, the correct answer is D.
Question 35:
Which option should be used to synchronize user data across publish servers in a publish farm?
A. Sling Content Distribution
B. Vault plugin
C. CURL
D. Replication Agents
Correct Answer: A
Explanation: Sling Content Distribution is a feature that allows synchronizing user data across publish servers in a publish farm. Sling Content Distribution uses agents to distribute content from one instance to another using a publish-publish
topology. Sling Content Distribution can be configured to synchronize user data under /home/users and /home/groups paths, as well as their ACLs.
The developer needs to implement a Sling Model to perform a business logic on the authored value. The developer writes the following HTL snippet.
Which two implementations will support this HTL snippet? (Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: BD
Explanation: Option B and Option D are two implementations that will support the HTL snippet. Option B uses the @Model annotation with the adaptables parameter set to Resource.class. This allows the Sling Model to adapt from a resource object and access its properties using the ValueMap interface. Option B also uses the @Inject annotation with the name parameter set to "./text" to inject the value of the text property into the text field. Option D uses the @Model annotation with the defaultInjectionStrategy parameter set to OPTIONAL. This allows the Sling Model to use optional injection for all fields and avoid null pointer exceptions if a property is missing. Option D also uses the @Inject annotation without any parameters to inject the value of the text property into the text field, using the field name as the default property name. References: https://sling.apache.org/documentation/bundles/models.htmlhttps://experienceleague.adob e.com/docs/experience-manager-htl/using-htl/htl-block-statements.html?lang=en#use
Question 37:
An AEM Developer needs to migrate to AEM as a Cloud Service from AEM version 6.4. The AEM Developer is not able to run the Best Practice Analyzer.
What is preventing the Best Practice Analyzer from running?
A. The AEM Developer is not an admin or does not have administrator rights.
B. Best Practice Analyzer is not supported on AEM version 6.4.
C. Best Practice Analyzer should run on Publisher instead of Author instance.
Correct Answer: B
The Best Practice Analyzer is a tool that scans an existing AEM code base and identifies patterns that are incompatible with AEM as a Cloud Service or newer versions of AEM on- premise. The Best Practice Analyzer is not supported on
AEM version 6.4 or earlier versions. The Best Practice Analyzer requires AEM version 6.5 or later to run.
Which property under /cache on dispatcher.any file identifies the directory where cached files are stored?
A. /invalidate
B. /statfile
C. /docroot
D. /cacheroot
Correct Answer: D
Explanation: The /cacheroot property under /cache in the dispatcher.any file identifies the directory where cached files are stored. It is a relative or absolute path to the cache root directory. The dispatcher creates a subdirectory for each virtual host under this directory and stores thecached files there. References: https://experienceleague.adobe.com/docs/experience-manager- dispatcher/using/configuring/dispatcher-configuration.html?lang=en#cache
Question 39:
In a non-optimized website, the final HTML generated for a typical page by publish instance includes a relatively large number of