Remove the IPManager
We don't need it anymore
This commit is contained in:
@@ -3,13 +3,9 @@ package fr.xephi.authme.cache;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@@ -35,29 +31,4 @@ public class IpAddressManagerTest {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldRetrieveFromCache() {
|
||||
// given
|
||||
IpAddressManager ipAddressManager = new IpAddressManager(mockSettings(true, true));
|
||||
ipAddressManager.addCache("Test", "my test IP");
|
||||
|
||||
// when
|
||||
String result = ipAddressManager.getPlayerIp(mockPlayer("test", "123.123.123.123"));
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("my test IP"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnPlainIp() {
|
||||
// given
|
||||
IpAddressManager ipAddressManager = new IpAddressManager(mockSettings(false, false));
|
||||
|
||||
// when
|
||||
String result = ipAddressManager.getPlayerIp(mockPlayer("bobby", "8.8.8.8"));
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo("8.8.8.8"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user