Skip to content
Kona

Filesystem testing

FilesystemManager.fake(name) mounts a temp-rooted local disk under that name and registers a simple temporary-URL builder. set(name, adapter) replaces any disk instance:

val files = app.resolve(FilesystemManager::class.java)
files.fake("photos")
files.disk("photos").put("a.jpg", byteArrayOf(1))
files.set("photos", FakeStorage())

org.konaframework.testing.FakeStorage is an in-memory FilesystemAdapter for unit tests that should not touch the filesystem. It implements the full adapter surface (streams, putFile, visibility, checksum, recursive listings). It does not support temporaryUrl — use files.fake(...) or buildTemporaryUrlsUsing when your code under test builds signed links.

See also Database & fakes.