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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package fr.xephi.authme.command;
|
||||
|
||||
import fr.xephi.authme.AntiBot;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.IpAddressManager;
|
||||
import fr.xephi.authme.command.help.HelpProvider;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
@@ -57,8 +56,6 @@ public class CommandServiceTest {
|
||||
@Mock
|
||||
private NewSetting settings;
|
||||
@Mock
|
||||
private IpAddressManager ipAddressManager;
|
||||
@Mock
|
||||
private PluginHooks pluginHooks;
|
||||
@Mock
|
||||
private SpawnLoader spawnLoader;
|
||||
@@ -70,7 +67,7 @@ public class CommandServiceTest {
|
||||
@Before
|
||||
public void setUpService() {
|
||||
commandService = new CommandService(authMe, commandMapper, helpProvider, messages, passwordSecurity,
|
||||
permissionsManager, settings, ipAddressManager, pluginHooks, spawnLoader, antiBot, validationService);
|
||||
permissionsManager, settings, pluginHooks, spawnLoader, antiBot, validationService);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -223,15 +220,6 @@ public class CommandServiceTest {
|
||||
assertThat(result, equalTo(authMe));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnIpAddressManager() {
|
||||
// given/when
|
||||
IpAddressManager ipManager = commandService.getIpAddressManager();
|
||||
|
||||
// then
|
||||
assertThat(ipManager, equalTo(ipAddressManager));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldValidatePassword() {
|
||||
// given
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package fr.xephi.authme.process;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.IpAddressManager;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.hooks.PluginHooks;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
@@ -39,8 +38,6 @@ public class ProcessServiceTest {
|
||||
@Mock
|
||||
private Messages messages;
|
||||
@Mock
|
||||
private IpAddressManager ipAddressManager;
|
||||
@Mock
|
||||
private PasswordSecurity passwordSecurity;
|
||||
@Mock
|
||||
private AuthMe authMe;
|
||||
@@ -53,7 +50,7 @@ public class ProcessServiceTest {
|
||||
|
||||
@Before
|
||||
public void setUpService() {
|
||||
processService = new ProcessService(settings, messages, authMe, dataSource, ipAddressManager, passwordSecurity,
|
||||
processService = new ProcessService(settings, messages, authMe, dataSource, passwordSecurity,
|
||||
pluginHooks, spawnLoader, validationService);
|
||||
}
|
||||
|
||||
@@ -154,15 +151,6 @@ public class ProcessServiceTest {
|
||||
assertThat(result, equalTo(pluginHooks));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnIpAddressManager() {
|
||||
// given / when
|
||||
IpAddressManager result = processService.getIpAddressManager();
|
||||
|
||||
// then
|
||||
assertThat(result, equalTo(ipAddressManager));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnSpawnLoader() {
|
||||
// given / when
|
||||
|
||||
Reference in New Issue
Block a user