HudsonPlugin implements VisuwallPlugin<HudsonConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { Preconditions.checkNotNull(url, "url is mandatory"); try { URL apiUrl = new URL(url.toString() + "/api/"); String xml = getContent(apiUrl); if (isManageable(xml)) { return createSoftwareId(xml); } throw new SoftwareNotFoundException("Url " + url + " is not compatible with Hudson, content: " + xml); } catch (MalformedURLException e) { throw new SoftwareNotFoundException("Url " + url + " is not compatible with Hudson", e); } catch (IOException e) { throw new SoftwareNotFoundException("Url " + url + " is not compatible with Hudson", e); } }  @Override HudsonConnection getConnection(URL url, Map<String, String> properties); @Override Class<HudsonConnection> getConnectionClass(); @Override String getName(); @Override float getVersion(); @Override SoftwareId getSoftwareId(URL url, Map<String, String> properties); @Override String toString(); @Override Map<String, String> getPropertiesWithDefaultValue();  }
@Test(expected = NullPointerException.class) public void should_throw_exception_when_passing_null_to_hudson_instance() throws SoftwareNotFoundException { new HudsonPlugin().getSoftwareId(null, properties); }