### Question:
SSLCertPlugin extends AbstractPlugin { @Override public boolean isProtocolSupported(InetAddress address) { throw new UnsupportedOperationException("Undirected SSL certificate checking not supported"); }  String getProtocolName(); @Override boolean isProtocolSupported(InetAddress address); @Override boolean isProtocolSupported(InetAddress address, Map<String, Object> qualifiers); static final String PARAMETER_TIMEOUT; static final String PARAMETER_RETRY; static final String PARAMETER_PORT; }### Answer:
@Test @JUnitHttpServer(port=10342, https=true) public void testSSLCertExists() throws UnknownHostException { Map<String, Object> m = new ConcurrentSkipListMap<String, Object>(); Parameter p = new Parameter(); SSLCertPlugin plugin = new SSLCertPlugin(); p.setKey("port"); p.setValue("10342"); m.put(p.getKey(), p.getValue()); p.setKey("retry"); p.setValue("1"); m.put(p.getKey(), p.getValue()); p.setKey("timeout"); p.setValue("3000"); m.put(p.getKey(), p.getValue()); assertTrue(plugin.isProtocolSupported(InetAddressUtils.getLocalHostAddress(), m)); }
@Test @JUnitHttpServer(port=10342, https=false) public void testSSLCertNotExists() throws UnknownHostException { Map<String, Object> m = new ConcurrentSkipListMap<String, Object>(); Parameter p = new Parameter(); SSLCertPlugin plugin = new SSLCertPlugin(); p.setKey("port"); p.setValue("10342"); m.put(p.getKey(), p.getValue()); p.setKey("retry"); p.setValue("1"); m.put(p.getKey(), p.getValue()); p.setKey("timeout"); p.setValue("3000"); m.put(p.getKey(), p.getValue()); assertFalse(plugin.isProtocolSupported(InetAddressUtils.getLocalHostAddress(), m)); }