|
1 | 1 | package com.baeldung.file; |
2 | 2 |
|
3 | | -import java.io.BufferedReader; |
4 | | -import java.io.File; |
5 | | -import java.io.FileInputStream; |
6 | | -import java.io.IOException; |
7 | | -import java.io.InputStream; |
8 | | -import java.io.InputStreamReader; |
| 3 | +import org.apache.commons.io.FileUtils; |
| 4 | +import org.hamcrest.CoreMatchers; |
| 5 | +import org.hamcrest.Matchers; |
| 6 | +import org.junit.Assert; |
| 7 | +import org.junit.Test; |
| 8 | + |
| 9 | +import java.io.*; |
9 | 10 | import java.net.URISyntaxException; |
10 | 11 | import java.net.URL; |
11 | 12 | import java.net.URLConnection; |
|
14 | 15 | import java.nio.file.Paths; |
15 | 16 | import java.util.stream.Stream; |
16 | 17 |
|
17 | | -import org.apache.commons.io.FileUtils; |
18 | | -import org.hamcrest.CoreMatchers; |
19 | | -import org.hamcrest.Matchers; |
20 | | -import org.junit.Assert; |
21 | | -import org.junit.Test; |
22 | | - |
23 | 18 | public class FileOperationsUnitTest { |
24 | 19 |
|
25 | 20 | @Test |
@@ -58,9 +53,9 @@ public void givenFileName_whenUsingJarFile_thenFileData() throws IOException { |
58 | 53 |
|
59 | 54 | @Test |
60 | 55 | public void givenURLName_whenUsingURL_thenFileData() throws IOException { |
61 | | - String expectedData = "Baeldung"; |
| 56 | + String expectedData = "Example Domain"; |
62 | 57 |
|
63 | | - URL urlObject = new URL("http://www.baeldung.com/"); |
| 58 | + URL urlObject = new URL("http://www.example.com/"); |
64 | 59 |
|
65 | 60 | URLConnection urlConnection = urlObject.openConnection(); |
66 | 61 |
|
|
0 commit comments