Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hi,
I've gone through Sling and AEM Mocks but none of those seem helpful to test our custom java classes which has services defined by us along with resource, jcr nodes, session etc. Sling and AEM mock only test Sling and JCR apis. Is there any way to test normal java classes as well along with it? Normal Junit with mockito and powermockito requires a lot more effort and we don't want to do that.
Any good examples would be helpful.
Thanks!
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
Yes. It should be good enough. We've used Mockito for our code coverage.
Test an AEM sling servlet using aem-mocks – AEM Quick Snippets
https://www.practicalaem.com/2016/01/19/testing-using-mockito/
Visualizações
respostas
Total de curtidas
do you have any examples for it? Ever tried AEMMock?
Visualizações
respostas
Total de curtidas
See this GEMS webinar - it shows best practice with respect to JUNIT testing with AEM -- From Unit Testing to Integration Test of an AEM Application
Visualizações
respostas
Total de curtidas
As mentioned by Scott, please go through this GEM session:- AEM Gems 12_14_16 Tools to use for testing AEM applications
~kautuk
Visualizações
respostas
Total de curtidas
Thank you for replying.
I’ve already gone through this document
But AEM Mocks and AEM Context seem more likely to test content, register OSGI services and AEM components only.
My question was - if we have normal java objects (which belong to different APIs) as well along with Sling and JCR APIs in a Java class do we have to use Mockito along with it, like we do it for normal junits or AEM Mocks would be sufficient?
If we can get some examples it’d be great.
Visualizações
respostas
Total de curtidas
Yes. It should be good enough. We've used Mockito for our code coverage.
Test an AEM sling servlet using aem-mocks – AEM Quick Snippets
https://www.practicalaem.com/2016/01/19/testing-using-mockito/
Great community content that you referenced here.
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas