elasticio / elasticio-cli

Command-line interface for elastic.io components
2 stars 1 forks source link

Steward (Attachment API) should be mocked #12

Open jhorbulyk opened 4 years ago

jhorbulyk commented 4 years ago

Steward (Attachment API) should be mocked and reading/storing attachments should be simulated.

hannah-bulmer commented 4 years ago

How do you mean reading/storing attachments should be simulated?

My understanding of this is that if a call to Steward is picked up, a fake random URL should be added to the emitted msg.attachments, to display conceptually a file "should" be there. This would work to simulate storing attachments, but what about reading them? Which library directly connects to the Steward API? It seems to be elasticio-rest-node but I could not find any specific code calling to Steward there.

A possibly option would be to expect users to provide a filepath in msg.attachments in their fixture, which is then read from, bypassing Steward. Are there any better solutions?