Always expect version 2.0
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 10 Jul 2015 04:57:59 +0000 (06:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 10 Jul 2015 04:57:59 +0000 (06:57 +0200)
src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java

index 42522e0..1f31d91 100644 (file)
@@ -27,15 +27,12 @@ public class DefaultFcpClient implements FcpClient {
        private final int port;
        private final AtomicReference<FcpConnection> fcpConnection = new AtomicReference<>();
        private final Supplier<String> clientName;
-       private final Supplier<String> expectedVersion;
 
-       public DefaultFcpClient(ExecutorService threadPool, String hostname, int port, Supplier<String> clientName,
-               Supplier<String> expectedVersion) {
+       public DefaultFcpClient(ExecutorService threadPool, String hostname, int port, Supplier<String> 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) {
index e44d03c..b547ca7 100644 (file)
@@ -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