What are good practices for tests when you need to...
# tornadofx
a
What are good practices for tests when you need to create temporary folder/files?
c
I usually just
File.createTempFile
👍 2
b
JUnit has a rule for TemporaryFolder's.
a
@belu thanks! Though there is a problem,
TemporaryFolder
utilizes
File
API, my class requires on
Path
😞
Files.createTempDirectory
is what I'm using right now
b
@alex You can convert that with File.toPath(). The advantage of TemporaryFolder is that it is cleaned up automatically after the test finishes (in case of success or failure).