Add an example of creating a file using FileOutputStream
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -37,6 +38,12 @@ public class CreateFileUnitTest {
assertTrue(success);
}
+ @Test
+ void givenUsingFileOutputStream_whenCreatingFile_thenCorrect() throws IOException {
+ try(FileOutputStream fileOutputStream = new FileOutputStream(FILE_NAME)){
+ }
+ }
+
@Test
public void givenUsingGuava_whenCreatingFile_thenCorrect() throws IOException {
com.google.common.io.Files.touch(new File(FILE_NAME));
