@BeforeClass public static void createTestFiles() throws IOException { final boolean result = TEST_FILE_DIRECTORY.mkdir() && TEST_FILE.createNewFile() && TEST_FILE_BAD_EXT.createNewFile(); if (!result) { throw new RuntimeException("unable to initialize test suite"); } }
@Test public void deleteDeletesUnderlyingStorableEntityFile() throws IOException { // Arrange: final File file = new File(TEST_FILE_DIRECTORY, "to-be-deleted.bar"); final TEntityFileDescriptor descriptor = this.createDescriptor(file); Assert.assertThat(file.createNewFile(), IsEqual.equalTo(true)); // Act: descriptor.delete(); // Assert: Assert.assertThat(file.exists(), IsEqual.equalTo(false)); }