File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
core-java/src/test/java/org/baeldung/java/io Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -52,15 +52,16 @@ public void whenAppendStringUsingBufferedWritter_thenOldContentShouldExistToo()
5252 }
5353
5454 @ Test
55- public void whenWriteFormattedStringUsingPrintWriter_thenOutputShouldBeFormatted () throws IOException {
55+ public void givenWritingStringToFile_whenUsingPrintWriter_thenCorrect () throws IOException {
5656 final FileWriter fileWriter = new FileWriter (fileName );
5757 final PrintWriter printWriter = new PrintWriter (fileWriter );
58+ printWriter .print ("Some String" );
5859 printWriter .printf ("Product name is %s and its price is %d $" , "iPhone" , 1000 );
5960 printWriter .close ();
6061 }
6162
6263 @ Test
63- public void whenWriteStringUsingFileOutputStream_thenCorrect () throws IOException {
64+ public void givenWritingStringToFile_whenUsingFileOutputStream_thenCorrect () throws IOException {
6465 final String str = "Hello" ;
6566 final FileOutputStream outputStream = new FileOutputStream (fileName3 );
6667 final byte [] strToBytes = str .getBytes ();
You can’t perform that action at this time.
0 commit comments