For the encounter case you are adding 3 complex obs and 1 non-complex obs to an encounter and you verify that you are indeed fetching 3 attachments for that encounter.
For the visit case, you will have to add complex obs and non complex obs across multiple encounters during that visit, and ensure that you are fetching the attachments that correspond to the complex obs for that visit.
Actually I have a small question. I create separate non context-sensitive method in Attachment resource for all the AttachmentService. So using mock test class is it enough to test that search method or do I need to rest API by sending the mock request ?
Actually I am still try on sending API request to AttachmentResource from the Mock Testing class. After finishing that I will send you my updated code. Is it ok ?
Sorry for so much time taken to mockup testing part. But Actually I am little bit stuck with that test implementation. I have add the new context independent search method to Attachment Resource.
But I am unable to test those methods. Can you please check that I am going the in the right path. ( And if you can please give me some suggestion about how to call the API in the Attachment Resource from the Mock test. )
with, for each test method, the parameters either mocked or set in a way that will trigger a certain call on as.
As you can see, you have missed one parameter to the search method. It should also take the service as a parameter, thatâs precisely in order to spy on it for eventually verifying that the appropriate methods where called.
There is an error occured when I tried to create the AttachmentResource1_10 object inside the AttachmentResourceTest . I think some configuration will failed when initiate the AttachmentResource1_10 object. So I modified the Search method as static method and it works. Is it ok to do that ?
I sent the PR yesterday. But it failed to build because of some old error we solved. Seems like it occurs again. Any idea for what we can do about that ? I will go trough again with that.
Something confuses me first, I see that in your PR, you are bringing again changes relating to the refactoring includeRetired â includeVoided. That shouldnât be since this was merged into master already.
Please always start your PR branch off master and bring in your incremental changes there.
When you have done that, can you confirm whether you see this problem arising locally as well?
Perfect! Now to fine tune the test, on top of what you have verified, we also need to verify that no other interactions happened with AttachmentsService.