NPipeSocketClientConnectionOperator implements HttpClientConnectionOperator { @Override public void upgrade(ManagedHttpClientConnection conn, HttpHost host, HttpContext context) throws IOException { throw new IOException("Connection upgrading is not supported."); } NPipeSocketClientConnectionOperator(NPipeSocketAddress pipeAddress); @Override void connect(ManagedHttpClientConnection conn, HttpHost host, InetSocketAddress localAddress, int connectTimeout, SocketConfig socketConfig, HttpContext context); @Override void upgrade(ManagedHttpClientConnection conn, HttpHost host, HttpContext context);  }
@Test public void connectionUpgradeUnsupported() { NPipeSocketClientConnectionOperator clientConnectionOperator = new NPipeSocketClientConnectionOperator(new NPipeSocketAddress(tempFile())); assertThatExceptionOfType(IOException.class). isThrownBy(() -> clientConnectionOperator.upgrade(new TestManagedHttpClientConnection(), new HttpHost("localhost"), new HttpClientContext())); }