JenkinsPlugin implements VisuwallPlugin<JenkinsConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { Preconditions.checkNotNull(url, "url is mandatory"); try { url = new URL(url.toString() + "/api/"); String content = Downloadables.getContent(url); JenkinsVersionPage jenkinsApiPage = new JenkinsVersionPage(content); if (jenkinsApiPage.isJenkinsApiPage()) { return jenkinsApiPage.createSoftwareId(); } } catch (IOException e) { if (LOG.isDebugEnabled()) { LOG.debug("Can't get content of " + url, e); } } throw new SoftwareNotFoundException("Url " + url + " is not compatible with Jenkins"); }  @Override JenkinsConnection getConnection(URL url, Map<String, String> properties); @Override Class<JenkinsConnection> 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_thrown_an_exception_when_passing_null_to_is_jenkins_instance() throws SoftwareNotFoundException { jenkinsPlugin.getSoftwareId(null, properties); }
@Test(expected = SoftwareNotFoundException.class) public void should_throw_exception_when_software_url_cant_be_reached() throws Exception { URL url = new URL("http: jenkinsPlugin.getSoftwareId(url, properties); }