DemoPlugin implements VisuwallPlugin<DemoConnection> { @Override public DemoConnection getConnection(URL url, Map<String, String> properties) throws ConnectionException { if (url == null || !DEMO_VISUWALL_CI.equals(url.toString())) { throw new ConnectionException(getName() + " is not compatible with url : " + url); } DemoConnection connection = new DemoConnection(); connection.connect(url.toString(), null, null); return connection; }  @Override DemoConnection getConnection(URL url, Map<String, String> properties); @Override Map<String, String> getPropertiesWithDefaultValue(); @Override Class<DemoConnection> getConnectionClass(); @Override float getVersion(); @Override String getName(); @Override SoftwareId getSoftwareId(URL url, Map<String, String> properties);  }
@Test(expected = ConnectionException.class) public void should_not_get_a_connection_for_url_other_than_demo() throws Exception { URL url = new URL("http: DemoConnection connection = plugin.getConnection(url, null); assertNull(connection); }
@Test public void should_get_a_connect_for_demo_url() throws Exception { URL url = new URL("http: DemoConnection connection = plugin.getConnection(url, null); assertNotNull(connection); }