mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-08 03:40:27 +01:00
Ask for free port in server address test
This commit is contained in:
parent
2e73f00331
commit
5579392b05
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user