#437 Add email should not allow to change email
- Create separate test for adding email - Check that no email is yet registered for add email
This commit is contained in:
@@ -2,6 +2,7 @@ package fr.xephi.authme.command.executable.email;
|
||||
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.process.Management;
|
||||
import fr.xephi.authme.util.WrapperMock;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -27,6 +28,7 @@ public class AddEmailCommandTest {
|
||||
@Before
|
||||
public void setUpMocks() {
|
||||
commandService = mock(CommandService.class);
|
||||
WrapperMock.createInstance();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -51,10 +53,10 @@ public class AddEmailCommandTest {
|
||||
given(commandService.getManagement()).willReturn(management);
|
||||
|
||||
// when
|
||||
command.executeCommand(sender, Arrays.asList("mail@example", "other_example"), commandService);
|
||||
command.executeCommand(sender, Arrays.asList("mail@example", "mail@example"), commandService);
|
||||
|
||||
// then
|
||||
verify(management).performAddEmail(sender, "mail@example", "other_example");
|
||||
verify(management).performAddEmail(sender, "mail@example");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user