Skip to content
Advertisement

Tag: aem

“resource.adaptTo” NullPointer Unit test AEM Sling Model Java

I’m doing a pretty basic Unit test for Sling Model in AEM, so, when I run the test I get the following error: [ERROR] CtaModelTest.testGetText:36 NullPointer This is my Java code, the Model is a very basic Sling AEM Model, I’m using the @ModelAnnotation as follow: Can anyone help me to fix it? Answer It seems that resource.adaptTo(CtaModel.class) returned null.

Publish/Unpublish Adobe AEM page from Java

We have background process that automatically creates AEM pages as well as deletes old AEM pages. For pages to appear/disappear on the published site, they need to be activated (Published) / deactivated (Unpublished). However, after searching from Google, I am not able to find AEM Java API that can publish/unpublish pages automatically. Where can I find information on how to

Advertisement