Logic for FoundCommandResult.Status / Add tests for CommandHandler
- Fix other tests - Add logic for smaller pending FIXME's
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ public class ChangePasswordCommandTest {
|
||||
ChangePasswordCommand command = new ChangePasswordCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, Collections.singletonList("pass"));
|
||||
command.executeCommand(sender, Arrays.asList("pass", "pass"));
|
||||
|
||||
// then
|
||||
verify(messagesMock).send(sender, MessageKey.NOT_LOGGED_IN);
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
@@ -52,7 +53,7 @@ public class AddEmailCommandTest {
|
||||
AddEmailCommand command = new AddEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
command.executeCommand(sender, Arrays.asList("mail@example", "other_example"));
|
||||
|
||||
// then
|
||||
verify(authMeMock).getManagement();
|
||||
|
||||
@@ -59,19 +59,4 @@ public class LoginCommandTest {
|
||||
Mockito.verify(managementMock).performLogin(eq(sender), eq("password"), eq(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldHandleMissingPassword() {
|
||||
// given
|
||||
Player sender = mock(Player.class);
|
||||
LoginCommand command = new LoginCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
|
||||
// then
|
||||
// TODO ljacqu 20151121: May make sense to handle null password in LoginCommand instead of forwarding the call
|
||||
String password = null;
|
||||
Mockito.verify(managementMock).performLogin(eq(sender), eq(password), eq(false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user