Close FCP server after each test
[jFCPlib.git] / src / test / java / net / pterodactylus / fcp / quelaton / DefaultFcpClientTest.java
index 86e7fae..affe1e9 100644 (file)
@@ -12,6 +12,7 @@ import java.util.concurrent.Future;
 import net.pterodactylus.fcp.FcpKeyPair;
 import net.pterodactylus.fcp.fake.FakeTcpServer;
 
+import org.junit.After;
 import org.junit.Test;
 
 /**
@@ -30,6 +31,11 @@ public class DefaultFcpClientTest {
                fcpClient = new DefaultFcpClient(threadPool, "localhost", fcpServer.getPort(), () -> "Test", () -> "2.0");
        }
 
+       @After
+       public void tearDown() throws IOException {
+               fcpServer.close();
+       }
+
        @Test
        public void defaultFcpClientCanGenerateKeypair() throws ExecutionException, InterruptedException, IOException {
                Future<FcpKeyPair> keyPairFuture = fcpClient.generateKeypair().execute();