AEM 6.1 unit testing and mocking slings, Jcr and Osgi

background

Hi,

So, I recently started working for a company using AEM 6.1, and I am also a junior developer.

When I meet my buddy (senior developer), he usually drives. But it doesn’t record unit tests, it hurts me. He explained that it is difficult to unit test AEM.

Our project uses HTTP requests and responses, the Osgi structure and a large Jcr repository, jsps, servlets and database connections. We use all kinds of design patterns, create adapter classes ... And so on.

Questions

Why is it difficult to create unit tests for AEM when there is a mocking framework for sling, Osgi and Jcr?

How can I find out unit test AEM 6.1?

moving forward ...

Am I looking for resources to create unit tests for AEM? If possible, can you indicate any resources below?

+4
source share
4 answers

I felt the same when I first started developing at AEM. Over time, I tried to change this for my company, and now we have an environment where we unit test our AEM code.

Why is it difficult to check the AEM code? I think the main reasons come down to two points:

  • Adobe JSP Java (). . , , Adobe, , "" . "libs", libs "", - . JSP, , , Java - . Java - , ? , . , Adobe , Java- . , . , unit test. . .java ( ). unit test - .
  • , AEM, , AEM. , /, AEM. .java, , , , . AEM . - "Uber".jar. , . JSP Java. unit test AEM, , , , AEM, IDE. , , IDE , Java.

# 2, "".jar, .jar AEM, , unit test Java-. AEM Uber.jar, . Mockito Java. Sling AEM, . . PowerMockito .

, Java-, AEM, Java. JavaScript Karma Jasmine - , .

, :

+2

, , , . " " (, ).

Unit- .

smth, Mockito ( mocks Mockito, JCR fixture JSON Sling mock).

+1

, uber jar , , API . AEM, . , UNobfuscated uber jar, Adobe.

0

Source: https://habr.com/ru/post/1656616/


All Articles