BAEL-4661: Add an example of creating a file using FileOutputStream (#10131)

This commit is contained in:
kwoyke
2020-10-06 08:08:09 +02:00
committed by GitHub
parent 0704ee4a59
commit 83c8040ded

View File

@@ -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));