Hello WireMock Community, I'm currently working on...
# help
a
Hello WireMock Community, I'm currently working on a project where I'm trying to use a database as the primary source for storing mappings and files, rather than relying on the filesystem. I've successfully managed to store mappings by implementing the 'MappingSource' interface. However, I'm encountering some challenges with storing files in the database. I came across the 'FileSource' interface, which seems like it should meet my needs. But upon delving into the code, I discovered dependencies related to 'BlobStoreFileSource' that have added to my confusion. Could anyone please provide some guidance or insights on how to effectively source files from a database using WireMock? Any advice or pointers to relevant documentation or examples would be greatly appreciated. Thanks in advance for your help!
t
The way to do this is to create your own implementation of the
Stores
interface and set this on WireMock’s config at startup.
The
FileSource
interface is now just a wrapper around
BlobStore
so provided you implement this the way you want, the internal instances of
FileSource
will back onto whatever store you implemented.
Please note that these interfaces are in beta so might change a bit between versions
a
Thanks @Tom for your inputs.