@Test public void testRetrievalOfConnectionBySocketAddress() { stubFor(get(urlEqualTo(connectionsUrl + "/127.0.0.1/53807")).willReturn(aResponse().withBody("{\n" + " \"connections\": [{\n" + " \"host\": \"127.0.0.1\",\n" + " \"port\": 53807\n" + " }]\n" + "}"))); ConnectionReport report = underTest.getConnection(new InetSocketAddress("127.0.0.1", 53807)); List<InetSocketAddress> connections = report.getAddresses(); assertEquals(1, connections.size()); InetSocketAddress address = connections.get(0); assertEquals("127.0.0.1", address.getAddress().getHostAddress()); assertEquals(53807, address.getPort()); }
public ConnectionReport getConnection(String host, int port) { return getConnectionsByUrl("/" + host + "/" + port); }
CurrentClient { public ConnectionReport getConnection(String host, int port) { return getConnectionsByUrl("/" + host + "/" + port); } }
CurrentClient { public ConnectionReport getConnection(String host, int port) { return getConnectionsByUrl("/" + host + "/" + port); } private  CurrentClient(String host, int port, int socketTimeout); }
CurrentClient { public ConnectionReport getConnection(String host, int port) { return getConnectionsByUrl("/" + host + "/" + port); } private  CurrentClient(String host, int port, int socketTimeout); static CurrentClientBuilder builder(); ConnectionReport getConnections(); ConnectionReport getConnections(String ip); ConnectionReport getConnections(InetAddress address); ConnectionReport getConnection(String host, int port); ConnectionReport getConnection(InetSocketAddress address); ClosedConnectionReport closeConnections(CloseType closeType); ClosedConnectionReport closeConnections(CloseType closeType, String ip); ClosedConnectionReport closeConnections(CloseType closeType, InetAddress address); ClosedConnectionReport closeConnection(CloseType closeType, String host, int port); ClosedConnectionReport closeConnection(CloseType closeType, InetSocketAddress address); boolean enableListener(); boolean disableListener(); boolean disableListener(int after); }
CurrentClient { public ConnectionReport getConnection(String host, int port) { return getConnectionsByUrl("/" + host + "/" + port); } private  CurrentClient(String host, int port, int socketTimeout); static CurrentClientBuilder builder(); ConnectionReport getConnections(); ConnectionReport getConnections(String ip); ConnectionReport getConnections(InetAddress address); ConnectionReport getConnection(String host, int port); ConnectionReport getConnection(InetSocketAddress address); ClosedConnectionReport closeConnections(CloseType closeType); ClosedConnectionReport closeConnections(CloseType closeType, String ip); ClosedConnectionReport closeConnections(CloseType closeType, InetAddress address); ClosedConnectionReport closeConnection(CloseType closeType, String host, int port); ClosedConnectionReport closeConnection(CloseType closeType, InetSocketAddress address); boolean enableListener(); boolean disableListener(); boolean disableListener(int after);  }