### Question:
UrlResource extends Resource { @Override public InputStream getInputStream() { try { URL url = new URL(path); return url.openStream(); } catch (MalformedURLException ex) { throw new ConstrettoException("Could not load URL. Path tried: [" + path + "]", ex); } catch (IOException e) { throw new ConstrettoException("Woot", e); } } UrlResource(String path); @Override boolean exists(); @Override InputStream getInputStream();  }### Answer:
@Test(expected = ConstrettoException.class) public void testOpenNonExistingUrlResource() throws Exception { final UrlResource urlResource = new UrlResource("http: urlResource.getInputStream(); }
@Test(expected = ConstrettoException.class) public void testOpenMalformedUrlResource() throws Exception { final UrlResource urlResource = new UrlResource("++malformed:url:resource"); urlResource.getInputStream(); }