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 2d128104d4
commit 90382576f6
1 changed files with 7 additions and 0 deletions

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