aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-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));
}