diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java index 67320c66a..ce7cbc98f 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java @@ -1,5 +1,6 @@ package com.velocitypowered.proxy.connection.client; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.velocitypowered.api.event.connection.ConnectionHandshakeEvent; @@ -144,6 +145,7 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler { * @param hostname the host name to clean * @return the cleaned hostname */ + @VisibleForTesting static String cleanVhost(String hostname) { // Clean out any anything after any zero bytes (this includes BungeeCord forwarding and the // legacy Forge handshake indicator). diff --git a/proxy/src/test/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandlerTest.java b/proxy/src/test/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandlerTest.java index b6f180c56..b57e344e1 100644 --- a/proxy/src/test/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandlerTest.java +++ b/proxy/src/test/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandlerTest.java @@ -1,10 +1,9 @@ package com.velocitypowered.proxy.connection.client; import static com.velocitypowered.proxy.connection.client.HandshakeSessionHandler.cleanVhost; -import static com.velocitypowered.proxy.connection.forge.legacy.LegacyForgeConstants.*; -import static org.junit.jupiter.api.Assertions.*; +import static com.velocitypowered.proxy.connection.forge.legacy.LegacyForgeConstants.HANDSHAKE_HOSTNAME_TOKEN; +import static org.junit.jupiter.api.Assertions.assertEquals; -import com.velocitypowered.proxy.connection.forge.legacy.LegacyForgeConstants; import org.junit.jupiter.api.Test; class HandshakeSessionHandlerTest {