-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
I'm working on a TempDirFactory implementation based on my own memory file system implementation over at marschall/memoryfilesystem-junit-provider. One of the features I would like to offer is configuration, allowing the user more control over the kind of file system they get (Windows, Unix, macOS, …). I imagine this configuration to be done through additional annotations on the element annotated with @TempDir, something like this
@TempDir(factory = MemoryFileSystemTempDirFactory.class)
@MemoryTempDirType(WINDOWS)
Path tempDirectory;(this can me made more compact with the help of meta-annotations)
For this to work, the TempDirFactory implementation needs access to this annotated element. Unfortunately TempDirFactory is only passed an ExtensionContext which only gives access to the test, not the element (method or field) annotated with @TempDir. What is needed is something like ParameterContext in ParameterResolver.
Deliverables
- extend
TempDirFactoryAPI to give access to annotated source element