From 977d29ffa0b9404307cedbd7b5386f505d8294c2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 30 Dec 2018 03:58:50 -0500 Subject: [PATCH] Fix Checkstyle errors --- .../proxy/connection/client/HandshakeSessionHandler.java | 2 ++ .../proxy/connection/client/HandshakeSessionHandlerTest.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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 {