I have code like this
def async_upload(external_id, pdf_body) do
Task.Supervisor.start_child(Docbox.DocumentUploadTask, fn ->
S3UploadService.save_document_to_s3(external_id, pdf_body)
end)
end
where Docbox.DocumentUploadTask is a TaskSupervisor. I need to test this piece of code by mocking and expecting the s3 put_object
call. But since this is run async, how will I do this?