@Test public void testRetrievalOfAllConnections() { stubFor(get(urlEqualTo(connectionsUrl)).willReturn(aResponse().withBody("{\n" + " \"connections\": [{\n" + " \"host\": \"127.0.0.1\",\n" + " \"port\": 53806\n" + " }, {\n" + " \"host\": \"127.0.0.1\",\n" + " \"port\": 53807\n" + " }, {\n" + " \"host\": \"127.0.0.3\",\n" + " \"port\": 53808\n" + " }]\n" + "}"))); ConnectionReport report = underTest.getConnections(); List<InetSocketAddress> connections = report.getAddresses(); assertEquals(3, connections.size()); InetSocketAddress connection0 = connections.get(0); assertEquals("127.0.0.1", connection0.getAddress().getHostAddress()); assertEquals(53806, connection0.getPort()); InetSocketAddress connection1 = connections.get(1); assertEquals("127.0.0.1", connection1.getAddress().getHostAddress()); assertEquals(53807, connection1.getPort()); InetSocketAddress connection2 = connections.get(2); assertEquals("127.0.0.3", connection2.getAddress().getHostAddress()); assertEquals(53808, connection2.getPort()); }
public ConnectionReport getConnections() { return getConnectionsByUrl(""); }
CurrentClient { public ConnectionReport getConnections() { return getConnectionsByUrl(""); } }
CurrentClient { public ConnectionReport getConnections() { return getConnectionsByUrl(""); } private  CurrentClient(String host, int port, int socketTimeout); }
CurrentClient { public ConnectionReport getConnections() { return getConnectionsByUrl(""); } 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 getConnections() { return getConnectionsByUrl(""); } 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);  }