From fb6b77740425fbe68654d3e92c69205469f05cc9 Mon Sep 17 00:00:00 2001 From: Fuzzlemann Date: Thu, 3 Aug 2017 20:13:44 +0200 Subject: [PATCH] Fix error at mockHTTPServer() --- Plan/src/test/java/utils/MockUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Plan/src/test/java/utils/MockUtils.java b/Plan/src/test/java/utils/MockUtils.java index 671861e91..a53069cfb 100644 --- a/Plan/src/test/java/utils/MockUtils.java +++ b/Plan/src/test/java/utils/MockUtils.java @@ -19,8 +19,6 @@ import org.powermock.api.mockito.PowerMockito; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.UnknownHostException; import java.util.HashSet; import java.util.Set; import java.util.UUID; @@ -158,7 +156,7 @@ public class MockUtils { public static HttpServer mockHTTPServer() throws IOException { HttpServer httpServer = PowerMockito.mock(HttpServer.class); - when(httpServer.getAddress()).thenReturn(new ServerSocket(80, 0, InetAddress.getByName(null)); + when(httpServer.getAddress()).thenReturn(new InetSocketAddress(80)); when(httpServer.getExecutor()).thenReturn(command -> System.out.println("HTTP Server command received")); return httpServer; }