@Test public void bad_urls_are_skipped(UrlParser f) throws MalformedURLException { List<String> mixed_uris = asList("http://example.com/good", "example.com/bad", "http://example.com/good2"); assertThat( f.apply(mixed_uris), equalTo(asList(new URL("http://example.com/good"), new URL("http://example.com/good2")))); }
@Test public void good_urls_pass(UrlParser f) throws MalformedURLException { List<String> good_uris = asList( "http://example.com/example_a", "http://example.com/example_b", "http://example.com/example_c"); assertThat( f.apply(good_uris), equalTo( asList( new URL("http://example.com/example_a"), new URL("http://example.com/example_b"), new URL("http://example.com/example_c")))); }