PivotalEntityResolver extends DefaultEntityResolver2 { @Override public InputSource resolveEntity(final String name, final String publicId, final String baseURI, final String systemId) throws SAXException, IOException { if (null == systemId) { return null; } Matcher matcher = SYSTEM_ID_ROOT.matcher(systemId); if (matcher.find()) { return getClassPathInputSource(publicId, systemId, matcher.replaceFirst(CLASSPATH_ROOT)); } return null; }  @Override InputSource resolveEntity(final String name, final String publicId, final String baseURI,
      final String systemId);  }
@Test public void resolvesWithHttpUrl() throws IOException, SAXException { InputSource inputSource = new PivotalEntityResolver().resolveEntity(null, null, null, "http: assertThat(inputSource).isNotNull(); }
@Test public void resolvesWithHttpsUrl() throws IOException, SAXException { InputSource inputSource = new PivotalEntityResolver().resolveEntity(null, null, null, "https: assertThat(inputSource).isNotNull(); }
@Test public void doesNotResolveUnknownUrl() throws IOException, SAXException { InputSource inputSource = new PivotalEntityResolver().resolveEntity(null, null, null, "http: assertThat(inputSource).isNull(); }