BAEL-4661: Add an example of creating a file using FileOutputStream (#10131)
This commit is contained in:
parent
2d128104d4
commit
90382576f6
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue