In this week i mainly focus on the mock testing with Mokito for Attachment Resource DoSearch() method. I finish the implementation of the do Search method with some modifications such as create separate context independent search method inside the AttachmentResource which will help to fetch the Attachments using AttachmentService based on the given Parameters. And also this Search method was created for help the mock testing implementation since it is context independent.
So Basically inside the Mock Test class, it test the newly added Search method with the different scenarios ( By changing the parameters ) and verify that relevant methods in the AttachmentService is triggered.Since we already developed the unit test for each method in the AttachmentService , we avoided testing the accuracy of the search method again by using Attachments. We just verify that relevant methods in the AttachmentService will triggered when we call the Search method with different parameters. All the new modifications are send to the mentor for review and wait for his feedbacks.