From: David ‘Bombe’ Roden Date: Fri, 10 Jul 2015 04:57:59 +0000 (+0200) Subject: Always expect version 2.0 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7b56cfbede438a0bfa113ca2fac36913047018bd;p=jFCPlib.git Always expect version 2.0 --- diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java b/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java index 42522e0..1f31d91 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java @@ -27,15 +27,12 @@ public class DefaultFcpClient implements FcpClient { private final int port; private final AtomicReference fcpConnection = new AtomicReference<>(); private final Supplier clientName; - private final Supplier expectedVersion; - public DefaultFcpClient(ExecutorService threadPool, String hostname, int port, Supplier clientName, - Supplier expectedVersion) { + public DefaultFcpClient(ExecutorService threadPool, String hostname, int port, Supplier clientName) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); this.hostname = hostname; this.port = port; this.clientName = clientName; - this.expectedVersion = expectedVersion; } private FcpConnection connect() throws IOException { @@ -52,7 +49,7 @@ public class DefaultFcpClient implements FcpClient { FcpConnection connection = new FcpConnection(hostname, port); connection.connect(); FcpReplySequence nodeHelloSequence = new ClientHelloReplySequence(connection); - ClientHello clientHello = new ClientHello(clientName.get(), expectedVersion.get()); + ClientHello clientHello = new ClientHello(clientName.get(), "2.0"); try { nodeHelloSequence.send(clientHello).get(); } catch (InterruptedException | ExecutionException e) { diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index e44d03c..b547ca7 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -48,7 +48,7 @@ public class DefaultFcpClientTest { public DefaultFcpClientTest() throws IOException { fcpServer = new FakeTcpServer(threadPool); - fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test", () -> "2.0"); + fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test"); } @After