### Question:
WebjarUriLocator implements UriLocator { @Override public InputStream locate(final String uri) throws IOException { LOG.debug("locating: {}", uri); try { final String fullpath = webjarAssetLocator.getFullPath(extractPath(uri)); return classpathLocator.locate(ClasspathUriLocator.createUri(fullpath)); } catch (final Exception e) { throw new IOException("No webjar with uri: " + uri + " available.", e); } }  static String createUri(final String path); @Override InputStream locate(final String uri); @Override boolean accept(final String uri); static final String ALIAS; static final String PREFIX; }### Answer:
@Test public void shouldFindValidWebjar() throws Exception { assertNotEmpty(victim.locate("webjar:jquery.js")); assertNotEmpty(victim.locate("webjar:jquery/2.0.0/jquery.js")); assertNotEmpty(victim.locate("webjar:/jquery/2.0.0/jquery.js")); }
@Test(expected = IOException.class) public void cannotFindInvalidWebjar() throws Exception { victim.locate("webjar:invalid.js"); }
@Test public void shouldNotFailWhenThereIsAWebjarResourceOutsideOfJar() throws IOException { assertNotEmpty(victim.locate("webjar:webjarFail.js")); }
@Test public void shouldLocateWebjarResourceContainingQuestionMarkInUri() throws Exception { victim.locate("webjar:font-awesome/4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3"); }