Blame eclipse warnings

This commit is contained in:
Gabriele C
2016-03-17 21:16:13 +01:00
parent 1462d3c39e
commit 19070c220b
19 changed files with 34 additions and 28 deletions
@@ -47,7 +47,7 @@ public class AccountsCommandTest {
public void shouldGetAccountsOfCurrentUser() {
// given
given(sender.getName()).willReturn("Tester");
List<String> arguments = Collections.EMPTY_LIST;
List<String> arguments = Collections.emptyList();
given(dataSource.getAuth("tester")).willReturn(authWithIp("123.45.67.89"));
given(dataSource.getAllAuthsByIp("123.45.67.89")).willReturn(Arrays.asList("Toaster", "Pester"));
@@ -81,7 +81,7 @@ public class AccountsCommandTest {
// given
List<String> arguments = Collections.singletonList("SomeUser");
given(dataSource.getAuth("someuser")).willReturn(mock(PlayerAuth.class));
given(dataSource.getAllAuthsByIp(anyString())).willReturn(Collections.EMPTY_LIST);
given(dataSource.getAllAuthsByIp(anyString())).willReturn(Collections.<String> emptyList());
// when
command.executeCommand(sender, arguments, service);
@@ -115,7 +115,7 @@ public class AccountsCommandTest {
public void shouldReturnIpUnknown() {
// given
List<String> arguments = Collections.singletonList("123.45.67.89");
given(dataSource.getAllAuthsByIp("123.45.67.89")).willReturn(Collections.EMPTY_LIST);
given(dataSource.getAllAuthsByIp("123.45.67.89")).willReturn(Collections.<String> emptyList());
// when
command.executeCommand(sender, arguments, service);
@@ -27,7 +27,7 @@ public class AuthMeCommandTest {
CommandService service = mock(CommandService.class);
// when
command.executeCommand(sender, Collections.EMPTY_LIST, service);
command.executeCommand(sender, Collections.<String> emptyList(), service);
// then
ArgumentCaptor<String> messagesCaptor = ArgumentCaptor.forClass(String.class);
@@ -36,7 +36,7 @@ public class FirstSpawnCommandTest {
ExecutableCommand command = new FirstSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(player).teleport(firstSpawn);
@@ -54,7 +54,7 @@ public class FirstSpawnCommandTest {
ExecutableCommand command = new FirstSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
@@ -103,7 +103,7 @@ public class LastLoginCommandTest {
ExecutableCommand command = new LastLoginCommand();
// when
command.executeCommand(sender, Collections.EMPTY_LIST, service);
command.executeCommand(sender, Collections.<String> emptyList(), service);
// then
verify(dataSource).getAuth(name);
@@ -61,7 +61,7 @@ public class PurgeLastPositionCommandTest {
ExecutableCommand command = new PurgeLastPositionCommand();
// when
command.executeCommand(sender, Collections.EMPTY_LIST, service);
command.executeCommand(sender, Collections.<String> emptyList(), service);
// then
verify(dataSource).getAuth(player);
@@ -37,7 +37,7 @@ public class ReloadCommandTest {
ExecutableCommand command = new ReloadCommand();
// when
command.executeCommand(sender, Collections.EMPTY_LIST, service);
command.executeCommand(sender, Collections.<String> emptyList(), service);
// then
verify(authMe).reload();
@@ -55,7 +55,7 @@ public class ReloadCommandTest {
ExecutableCommand command = new ReloadCommand();
// when
command.executeCommand(sender, Collections.EMPTY_LIST, service);
command.executeCommand(sender, Collections.<String> emptyList(), service);
// then
verify(authMe).reload();
@@ -35,7 +35,7 @@ public class SetFirstSpawnCommandTest {
ExecutableCommand command = new SetFirstSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(spawnLoader).setFirstSpawn(location);
@@ -57,7 +57,7 @@ public class SetFirstSpawnCommandTest {
ExecutableCommand command = new SetFirstSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(spawnLoader).setFirstSpawn(location);
@@ -35,7 +35,7 @@ public class SetSpawnCommandTest {
ExecutableCommand command = new SetSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(spawnLoader).setSpawn(location);
@@ -57,7 +57,7 @@ public class SetSpawnCommandTest {
ExecutableCommand command = new SetSpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(spawnLoader).setSpawn(location);
@@ -35,7 +35,7 @@ public class SpawnCommandTest {
ExecutableCommand command = new SpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(player).teleport(spawn);
@@ -53,7 +53,7 @@ public class SpawnCommandTest {
ExecutableCommand command = new SpawnCommand();
// when
command.executeCommand(player, Collections.EMPTY_LIST, service);
command.executeCommand(player, Collections.<String> emptyList(), service);
// then
verify(player).sendMessage(argThat(containsString("Spawn has failed")));
@@ -44,7 +44,7 @@ public class ChangePasswordCommandTest {
when(commandService.getProperty(SecuritySettings.MAX_PASSWORD_LENGTH)).thenReturn(50);
// Only allow passwords with alphanumerical characters for the test
when(commandService.getProperty(RestrictionSettings.ALLOWED_PASSWORD_REGEX)).thenReturn("[a-zA-Z0-9]+");
when(commandService.getProperty(SecuritySettings.UNSAFE_PASSWORDS)).thenReturn(Collections.EMPTY_LIST);
when(commandService.getProperty(SecuritySettings.UNSAFE_PASSWORDS)).thenReturn(Collections.<String> emptyList());
}
@Test