Fix fake TCP server test
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 5 Jul 2015 20:22:00 +0000 (22:22 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 5 Jul 2015 20:22:00 +0000 (22:22 +0200)
src/test/java/net/pterodactylus/fcp/fake/FakeTcpServerTest.java

index 976dcd6..b37dbf8 100644 (file)
@@ -45,8 +45,9 @@ public class FakeTcpServerTest {
                        public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
                        }
                });
-               tcpServer.connect();
+               Future<?> connect = tcpServer.connect();
                try (TextSocket clientSocket = new TextSocket(new Socket("127.0.0.1", tcpServer.getPort()))) {
+                       connect.get();
                        clientSocket.writeLine("Hello");
                        clientSocket.writeLine("Bye");
                        List<String> receivedLines = tcpServer.collectUntil(is("Bye"));