@Test void connect_secure() { assertThatThrownBy(() -> SUT.getConnection(null, null)).isInstanceOf(PlcConnectionException.class); }
@Override public PlcConnection getConnection(String url) throws PlcConnectionException { String deviceName = url.substring(getProtocolCode().length() + 1); if (deviceName.isEmpty()) { throw new PlcConnectionException("Invalid URL: no device name given."); } SimulatedDevice device = new SimulatedDevice(deviceName); return new SimulatedConnection(device); }
SimulatedDriver implements PlcDriver { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { String deviceName = url.substring(getProtocolCode().length() + 1); if (deviceName.isEmpty()) { throw new PlcConnectionException("Invalid URL: no device name given."); } SimulatedDevice device = new SimulatedDevice(deviceName); return new SimulatedConnection(device); } }
SimulatedDriver implements PlcDriver { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { String deviceName = url.substring(getProtocolCode().length() + 1); if (deviceName.isEmpty()) { throw new PlcConnectionException("Invalid URL: no device name given."); } SimulatedDevice device = new SimulatedDevice(deviceName); return new SimulatedConnection(device); }  }
SimulatedDriver implements PlcDriver { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { String deviceName = url.substring(getProtocolCode().length() + 1); if (deviceName.isEmpty()) { throw new PlcConnectionException("Invalid URL: no device name given."); } SimulatedDevice device = new SimulatedDevice(deviceName); return new SimulatedConnection(device); }  @Override String getProtocolCode(); @Override String getProtocolName(); @Override PlcConnection getConnection(String url); @Override PlcConnection getConnection(String url, PlcAuthentication authentication); @Override SimulatedField prepareField(String query); }
SimulatedDriver implements PlcDriver { @Override public PlcConnection getConnection(String url) throws PlcConnectionException { String deviceName = url.substring(getProtocolCode().length() + 1); if (deviceName.isEmpty()) { throw new PlcConnectionException("Invalid URL: no device name given."); } SimulatedDevice device = new SimulatedDevice(deviceName); return new SimulatedConnection(device); }  @Override String getProtocolCode(); @Override String getProtocolName(); @Override PlcConnection getConnection(String url); @Override PlcConnection getConnection(String url, PlcAuthentication authentication); @Override SimulatedField prepareField(String query);  }