From 301275c432501d9709168e69bb685c073fb621de Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 10 Mar 2020 22:51:04 +0300 Subject: Mail unsubscribe API --- src/test/java/com/juick/server/tests/ServerTests.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test/java/com/juick/server/tests') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 0b915431f..ebfcda08b 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)); } -- cgit v1.2.3