From 7b56cfbede438a0bfa113ca2fac36913047018bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Jul 2015 06:57:59 +0200 Subject: [PATCH] Always expect version 2.0 --- src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java | 7 ++----- .../java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) 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 -- 2.7.4