Blame eclipse warnings
This commit is contained in:
@@ -30,7 +30,7 @@ public class CommandUtilsTest {
|
||||
@Test
|
||||
public void shouldPrintEmptyStringForNoArguments() {
|
||||
// given
|
||||
List<String> parts = Collections.EMPTY_LIST;
|
||||
List<String> parts = Collections.emptyList();
|
||||
|
||||
// when
|
||||
String str = CommandUtils.labelsToString(parts);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PlayerCommandTest {
|
||||
PlayerCommandImpl command = new PlayerCommandImpl();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, Collections.EMPTY_LIST, mock(CommandService.class));
|
||||
command.executeCommand(sender, Collections.<String> emptyList(), mock(CommandService.class));
|
||||
|
||||
// then
|
||||
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
|
||||
@@ -58,7 +58,7 @@ public class PlayerCommandTest {
|
||||
PlayerCommandWithAlt command = new PlayerCommandWithAlt();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, Collections.EMPTY_LIST, mock(CommandService.class));
|
||||
command.executeCommand(sender, Collections.<String> emptyList(), mock(CommandService.class));
|
||||
|
||||
// then
|
||||
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+2
-2
@@ -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")));
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -253,7 +253,7 @@ public class HelpProviderTest {
|
||||
public void shouldHandleUnboundFoundCommandResult() {
|
||||
// given
|
||||
FoundCommandResult result = new FoundCommandResult(null, Arrays.asList("authme", "test"),
|
||||
Collections.EMPTY_LIST, 0.0, FoundResultStatus.UNKNOWN_LABEL);
|
||||
Collections.<String> emptyList(), 0.0, FoundResultStatus.UNKNOWN_LABEL);
|
||||
|
||||
// when
|
||||
List<String> lines = helpProvider.printHelp(sender, result, ALL_OPTIONS);
|
||||
@@ -317,7 +317,7 @@ public class HelpProviderTest {
|
||||
* @return The generated FoundCommandResult object
|
||||
*/
|
||||
private static FoundCommandResult newFoundResult(CommandDescription command, List<String> labels) {
|
||||
return new FoundCommandResult(command, labels, Collections.EMPTY_LIST, 0.0, FoundResultStatus.SUCCESS);
|
||||
return new FoundCommandResult(command, labels, Collections.<String> emptyList(), 0.0, FoundResultStatus.SUCCESS);
|
||||
}
|
||||
|
||||
private static String removeColors(String str) {
|
||||
|
||||
Reference in New Issue
Block a user