Remove the IPManager

We don't need it anymore
This commit is contained in:
Gabriele C
2016-04-08 14:34:21 +02:00
parent 4ec98e5b3d
commit ee177e8a3a
17 changed files with 33 additions and 219 deletions
@@ -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"));
}
}