Change to new HelpProvider, adjust classes to new methods
This commit is contained in:
@@ -11,7 +11,6 @@ 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;
|
||||
@@ -40,7 +39,7 @@ public class AddEmailCommandTest {
|
||||
AddEmailCommand command = new AddEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, newParts(), newParts());
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
|
||||
// then
|
||||
verify(authMeMock, never()).getManagement();
|
||||
@@ -53,15 +52,11 @@ public class AddEmailCommandTest {
|
||||
AddEmailCommand command = new AddEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, newParts(),
|
||||
new CommandParts(Arrays.asList("mail@example", "other_example")));
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
|
||||
// then
|
||||
verify(authMeMock).getManagement();
|
||||
verify(managementMock).performAddEmail(sender, "mail@example", "other_example");
|
||||
}
|
||||
|
||||
private static CommandParts newParts() {
|
||||
return new CommandParts(new ArrayList<String>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ChangeEmailCommandTest {
|
||||
ChangeEmailCommand command = new ChangeEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, newParts(), newParts());
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
|
||||
// then
|
||||
verify(authMeMock, never()).getManagement();
|
||||
@@ -53,15 +53,11 @@ public class ChangeEmailCommandTest {
|
||||
ChangeEmailCommand command = new ChangeEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, newParts(),
|
||||
new CommandParts(Arrays.asList("new.mail@example.org", "old_mail@example.org")));
|
||||
command.executeCommand(sender, Arrays.asList("new.mail@example.org", "old_mail@example.org"));
|
||||
|
||||
// then
|
||||
verify(authMeMock).getManagement();
|
||||
verify(managementMock).performChangeEmail(sender, "new.mail@example.org", "old_mail@example.org");
|
||||
}
|
||||
|
||||
private static CommandParts newParts() {
|
||||
return new CommandParts(new ArrayList<String>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Test for {@link RecoverEmailCommand}.
|
||||
@@ -28,7 +28,7 @@ public class RecoverEmailCommandTest {
|
||||
RecoverEmailCommand command = new RecoverEmailCommand();
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, new CommandParts(Collections.EMPTY_LIST), new CommandParts(Collections.EMPTY_LIST));
|
||||
command.executeCommand(sender, new ArrayList<String>());
|
||||
|
||||
// then
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user