### Question:
PluginConfiguration implements JsonInitializable { public Set<URL> getPluginUrls() { return Collections.unmodifiableSet(externalPaths); } PluginConfiguration();  PluginConfiguration(JsonNode node); Set<URL> getPluginUrls(); @Override void initializeFromJson(JsonNode node); @Override String toString(); final static String PROTOCOL_FILE; }### Answer:
@Test public void testHttpURL() throws Exception { PluginConfiguration config = new PluginConfiguration(JsonUtils.json( "[\"http: Set<URL> urls = config.getPluginUrls(); assertNotNull(urls); assertEquals(1, urls.size()); assertUrlEquals(urls.iterator().next(), "my.jar", "http"); }
@Test public void testFileURL() throws Exception { URL dirUrl = getClass().getResource( "/externalResourcesConfiguration"); PluginConfiguration config = new PluginConfiguration(JsonUtils.json( "[\"file: Set<URL> urls = config.getPluginUrls(); assertNotNull(urls); assertEquals(2, urls.size()); List<URL> sortedUrls = new ArrayList<URL>(urls); Collections.sort(sortedUrls, new Comparator<URL>() { @Override public int compare(URL o1, URL o2) { return o1.getPath().compareTo(o2.getPath()); } }); assertUrlEquals(sortedUrls.get(0), "not_really_a_jar.jar", "file"); assertUrlEquals(sortedUrls.get(1), "also_not_really_a_jar.jar", "file"); }