Hi @anasustic , For writing Junits for OSGi Code, You can go for Mockito
framework and use AEMContext to mock the resources. Or you can use Sling
Mocks-
https://sling.apache.org/documentation/development/sling-mock.htmlPlease
refer the below links for your reference,
https://aemhints.com/2020/12/19/junit-test-in-aem-6-5-servlet/https://myaemlearnings.blogspot.com/2020/07/unit-testing-hands-on-for-sling-servlet.htmlhttps://www.youtube.com/watch?v=hY_b3d9VZ_k