Time Taken for AEM Junit Class | Community
Skip to main content
iamnjain
Community Advisor
Community Advisor
September 1, 2023
Solved

Time Taken for AEM Junit Class

  • September 1, 2023
  • 1 reply
  • 947 views

Hello,

 

I was going through my codebase build logs to see why It's taking longer time to build in cloud manager, and noticed one time consuming stats in Core bundle test execution. We have lot of Sling Models, some of them are finished executing test classes in less than 10 sec, but few are taking more than 10 secs, and some taking 30-50 secs 😮

So, what's the ideal or best performant time taken for a Junit class?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

Hello @iamnjain 

 

You might already be aware that with AEM we can use:

 

If you are using the wcm.io framework, then following slide might interest you:

The link [1] talks in detail about the wcm.io framework, and which type of Resource Resolver mock to use in which case.

[1]: https://wcm.io/testing/aem-mock/slides/190319_AtACE_UnitTestingWithAEMMocks.pdf

 

For other frameworks like Junit5 and Mockito, there would be ample links online suggesting the best practices, like:

https://medium.com/@samuelcatalano/best-practices-for-java-testing-with-mockito-56532ee16918

 

They should help you out

1 reply

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
September 1, 2023

Hello @iamnjain 

 

You might already be aware that with AEM we can use:

 

If you are using the wcm.io framework, then following slide might interest you:

The link [1] talks in detail about the wcm.io framework, and which type of Resource Resolver mock to use in which case.

[1]: https://wcm.io/testing/aem-mock/slides/190319_AtACE_UnitTestingWithAEMMocks.pdf

 

For other frameworks like Junit5 and Mockito, there would be ample links online suggesting the best practices, like:

https://medium.com/@samuelcatalano/best-practices-for-java-testing-with-mockito-56532ee16918

 

They should help you out

Aanchal Sikka