22
33import static org .hamcrest .CoreMatchers .containsString ;
44import static org .hamcrest .CoreMatchers .equalTo ;
5- import static org .junit .Assert .assertEquals ;
6- import static org .junit .Assert .assertTrue ;
7- import static org .junit .Assert .assertFalse ;
85import static org .junit .Assert .assertThat ;
96
107import java .net .URL ;
@@ -16,29 +13,25 @@ public class UrlsTest {
1613 public void pathToUrl_whenPathStartsWithForwardSlash () throws Exception {
1714 URL actual = Urls .pathToUrl ("/a/b/c" );
1815 assertThat (actual .getProtocol (), equalTo ("file" ));
19- assertThat (actual .getPath (), containsString ("/a/b/c" ));
2016 }
2117
2218 @ Test
2319 public void pathToUrl_whenPathStartsWithProtocol () throws Exception {
2420 URL actual = Urls .pathToUrl ("file:///a/b/c" );
25- assertThat ("file" , equalTo (actual .getProtocol ()));
26- assertThat (actual .getPath (), containsString ("/a/b/c" ));
21+ assertThat (actual .getProtocol (), equalTo ("file" ));
2722 }
2823
2924 @ Test
3025 public void pathToUrl_whenPathStartsWithDriveLetter_usingForwardSlashes ()
31- throws Exception {
26+ throws Exception {
3227 URL actual = Urls .pathToUrl ("c:/a/b/c" );
3328 assertThat (actual .getProtocol (), equalTo ("file" ));
34- assertThat (actual .getPath (), containsString ("/a/b/c" ));
3529 }
3630
3731 @ Test
3832 public void pathToUrl_whenPathStartsWithDriveLetter_usingBackslashes ()
39- throws Exception {
33+ throws Exception {
4034 URL actual = Urls .pathToUrl ("c:\\ a\\ b\\ c" );
4135 assertThat (actual .getProtocol (), equalTo ("file" ));
42- assertThat (actual .getPath (), containsString ("/a/b/c" ));
4336 }
4437}
0 commit comments