use of org.junit.jupiter.api.Assertions in project java-design-patterns by iluwatar.
the class SimpleFileWriterTest method testWriterNotNull.
/**
* Verify if the given writer is not 'null'
*/
@Test
public void testWriterNotNull() throws Exception {
final File temporaryFile = this.testFolder.newFile();
new SimpleFileWriter(temporaryFile.getPath(), Assertions::assertNotNull);
}
use of org.junit.jupiter.api.Assertions in project java-design-patterns by iluwatar.
the class SimpleFileWriterTest method testNonExistentFile.
/**
* Test if the {@link SimpleFileWriter} creates a file if it doesn't exist
*/
@Test
public void testNonExistentFile() throws Exception {
final File nonExistingFile = new File(this.testFolder.getRoot(), "non-existing-file");
assertFalse(nonExistingFile.exists());
new SimpleFileWriter(nonExistingFile.getPath(), Assertions::assertNotNull);
assertTrue(nonExistingFile.exists());
}
Aggregations