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.
![rajat168_0-1725025119559.png rajat168_0-1725025119559.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/79497i9A3A9C05BD0647C1/image-size/medium?v=v2&px=400)
In Junit TestCase file the factory was not null ,PFB screenshot.
![rajat168_1-1725025236404.png rajat168_1-1725025236404.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/79498iB11DDCA7A79A8D5E/image-size/medium?v=v2&px=400)
![rajat168_2-1725025337969.png rajat168_2-1725025337969.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/79499iD31FA3A3239F459F/image-size/medium?v=v2&px=400)
In SearchServiceImpl, its getting null. PFB screenshot.
![rajat168_3-1725025408865.png rajat168_3-1725025408865.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/79500i7BE2BEB1EBB1F81A/image-size/medium?v=v2&px=400)
my searchresultServlet, PFB
![rajat168_4-1725025534709.png rajat168_4-1725025534709.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/79501iA5214811708BDEAD/image-size/medium?v=v2&px=400)