AEM JUNIT #2 | Unit Test for Sling Servlet's GET method in aem

preview_player
Показать описание
How to write unit test for sling servlet's GET methods. How to create resource using AemContext and how to get mocked SlingHttpServletRequest and SlingHttpServletResponse object for unit test. How to assert doGet() response.
Рекомендации по теме
Комментарии
Автор

Thank you for such an amazing explanation.. But I have followed the exact same steps for my servlet but Im getting null pointer exception in my test cases..

goutamhegde
Автор

here we can set resource by giving path, but what if we are going to test on jsonObject

SandeepKumarSingh-dprt
Автор

Also please make tutorials for writing junit for OSGI services too😀

goutamhegde
Автор

Hi .. What if servlet is returning a JSON Object?

avishekhsinhautube