Expand my Community achievements bar.

SOLVED

Time Taken for AEM Junit Class

Avatar

Community Advisor

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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:

aanchalsikka_0-1693584706344.png

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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:

aanchalsikka_0-1693584706344.png

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