![]() ![]() * be exploited to create security vulnerabilities, especially when executable files are to be * delete the file and create a directory in its place, but this leads a race condition which can If you are using JUnit Jupiter (version 5.1.1 or greater), you have the option to use JUnit Pioneer which is the JUnit 5 Extension Pack.įor example, the following test registers the extension for a single test method, creates and writes a file to the temporary directory and checks its content. The TemporaryFolder Rule allows creation of files and folders that are guaranteed to be deleted when the test method finishes (whether it passes or fails) ![]() If you need a temporary directory for testing and you are using jUnit, together with TemporaryFolder solves your problem: TemporaryFolder folder = new TemporaryFolder()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |