resourceResolverFactory getting null in serviceImpl class while writing Junit.
Hi team,
we are on AEMCS ENV, we were trying to write test case for a search servlet. when we execute the search servlet doget method from servlet its executing successfully but in SearchserviceImpl.java Class the @Mock private ResourceResolverFactory resourceResolverFactory getting null. Kindly please suggest on this. please find the code snippet.

In Junit TestCase file the factory was not null ,PFB screenshot.


In SearchServiceImpl, its getting null. PFB screenshot.

my searchresultServlet, PFB



