Hi @ravi_joshi,Please find below thread where I had a chance to share
sample test class for Query Builder logic in Sling Servlet.
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-servlet-junit-writing-which-using-querybuilder/td-p/375359
You can use the mock implementation (in @BeforeEach method) in your
Sling Model Test case and continue per your Sling Model logic. If you
face any issues, please do share your actual Sling Model class if
possible.