AccountIT: Add test for adding email without confirmation
Test that attempting to add an email without confirmation, by a user that does not have "Modify Account" permission, is not accepted. Change-Id: Ib1917357bde4704814bab1c9ebc48467a55a6545
This commit is contained in:
@@ -436,6 +436,17 @@ public class AccountIT extends AbstractDaemonTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cannotAddNonConfirmedEmailWithoutModifyAccountPermission() throws Exception {
|
||||
TestAccount account = accounts.create(name("user"));
|
||||
EmailInput input = new EmailInput();
|
||||
input.email = "test@test.com";
|
||||
input.noConfirmation = true;
|
||||
setApiUser(user);
|
||||
exception.expect(AuthException.class);
|
||||
gApi.accounts().id(account.username).addEmail(input);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void deleteEmail() throws Exception {
|
||||
String email = "foo.bar@example.com";
|
||||
|
Reference in New Issue
Block a user