AEM Sites WKND Tutorials - Unit Testing | Community
Skip to main content
Level 3
May 27, 2025
Solved

AEM Sites WKND Tutorials - Unit Testing

  • May 27, 2025
  • 1 reply
  • 372 views

Hi all,

 

I am following AEM Sites WKND Tutorials - Unit Testing. https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/unit-testing#reviewing-bylineimpl-java

 

It says:
"Unit tests typically map 1-to-1 with Java™ classes. In this chapter, we’ll write a JUnit test for the BylineImpl.java, which is the Sling Model backing the Byline component."

 

But the Sling Model backing the Byline component was Byline.java.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/custom-component#create-sling-model

 

Also Byline.java was created in folder core/src/main/java/com/adobe/aem/guides/wknd/core/models, but 

BylineImpl.java shows src/main/java/com/adobe/aem/guides/wknd/core/models/impl folder.

 

Now, I can not use Byline.java created earlier in the parent folder of thee expected folder in this exercise.

 

Please suggest.

 

Appreciate your replies.

 

Thanks,

RK.

 

Best answer by PRATHYUSHA_VP

Hi @rama_krishnany 

 

ByLineImpl.java is the implementation class for Byline.java

If you cover the unit test case for BylineImpl.java, it will cover the test case for Byline.java

 

Hope this helps

 

 

1 reply

PRATHYUSHA_VP
Community Advisor
PRATHYUSHA_VPCommunity AdvisorAccepted solution
Community Advisor
May 27, 2025

Hi @rama_krishnany 

 

ByLineImpl.java is the implementation class for Byline.java

If you cover the unit test case for BylineImpl.java, it will cover the test case for Byline.java

 

Hope this helps