From 5579392b05082ff46fab5b8fba6c69c208485f45 Mon Sep 17 00:00:00 2001 From: themode Date: Mon, 7 Mar 2022 10:02:09 +0100 Subject: [PATCH] Ask for free port in server address test --- .../net/minestom/server/network/socket/ServerAddressTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/minestom/server/network/socket/ServerAddressTest.java b/src/test/java/net/minestom/server/network/socket/ServerAddressTest.java index 7011003f1..e75be6360 100644 --- a/src/test/java/net/minestom/server/network/socket/ServerAddressTest.java +++ b/src/test/java/net/minestom/server/network/socket/ServerAddressTest.java @@ -1,6 +1,7 @@ package net.minestom.server.network.socket; import net.minestom.server.network.PacketProcessor; +import net.minestom.server.utils.NetworkUtils; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -14,7 +15,7 @@ public class ServerAddressTest { @Test public void inetAddressTest() throws IOException { - InetSocketAddress address = new InetSocketAddress("localhost", 25565); + InetSocketAddress address = new InetSocketAddress("localhost", NetworkUtils.getFreePort()); var server = new Server(new PacketProcessor()); server.init(address); assertSame(address, server.socketAddress());