@Test public void close() throws Exception { underTest.connect(); doReturn(true).when(underTest).isConnected(); underTest.close(); verify(session).close(); }
@Override public void close() throws Exception { disposable.dispose(); if (isConnected()) { try { session.close(); log.info("Disconnected session: {}", session.getId()); session = null; } catch (IOException e) { throw new UncheckedIOException(e); } } }
WebSocket implements AutoCloseable { @Override public void close() throws Exception { disposable.dispose(); if (isConnected()) { try { session.close(); log.info("Disconnected session: {}", session.getId()); session = null; } catch (IOException e) { throw new UncheckedIOException(e); } } } }
WebSocket implements AutoCloseable { @Override public void close() throws Exception { disposable.dispose(); if (isConnected()) { try { session.close(); log.info("Disconnected session: {}", session.getId()); session = null; } catch (IOException e) { throw new UncheckedIOException(e); } } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); }
WebSocket implements AutoCloseable { @Override public void close() throws Exception { disposable.dispose(); if (isConnected()) { try { session.close(); log.info("Disconnected session: {}", session.getId()); session = null; } catch (IOException e) { throw new UncheckedIOException(e); } } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); @Override void close(); }
WebSocket implements AutoCloseable { @Override public void close() throws Exception { disposable.dispose(); if (isConnected()) { try { session.close(); log.info("Disconnected session: {}", session.getId()); session = null; } catch (IOException e) { throw new UncheckedIOException(e); } } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); @Override void close();  }