Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
- Loading branch information