aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-03-10 22:51:04 +0300
committerGravatar Vitaly Takmazov2020-03-10 22:51:04 +0300
commit301275c432501d9709168e69bb685c073fb621de (patch)
tree249d7e42f61f0917e1f426ab281fa5310c531ee1 /src/test/java/com/juick/server/tests
parentc28afe791bd1be6ba2999d688f4ea2b00925ad37 (diff)
Mail unsubscribe API
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 0b915431..ebfcda08 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -462,6 +462,11 @@ public class ServerTests {
User hugnich3 = userService.createUser("hugnich3", "x").orElseThrow(IllegalStateException::new);
jdbcTemplate.update("INSERT INTO emails(user_id,email) VALUES(?,?)", hugnich3.getUid(), "first@localhost");
jdbcTemplate.update("INSERT INTO emails(user_id,email) VALUES(?,?)", hugnich3.getUid(), "second@localhost");
+ emailService.addEmail(hugnich3.getUid(), "test@email.example.com");
+ assertThat(emailService.getNotificationsEmail(hugnich3.getUid()), is("test@email.example.com"));
+ emailService.disableEmail(hugnich3, "test@email.example.com");
+ assertThat(emailService.getNotificationsEmail(hugnich3.getUid()), is(emptyString()));
+ assertThat(emailService.deleteEmail(hugnich3.getUid(), "test@email.example.com"), equalTo(true));
assertThat(emailService.deleteEmail(hugnich3.getUid(), "second@localhost"), equalTo(true));
assertThat(emailService.deleteEmail(hugnich3.getUid(), "first@localhost"), equalTo(false));
}