import club.wpia.gigi.dbObjects.EmailAddress;
import club.wpia.gigi.dbObjects.Group;
import club.wpia.gigi.dbObjects.NamePart;
-import club.wpia.gigi.dbObjects.User;
import club.wpia.gigi.dbObjects.NamePart.NamePartType;
+import club.wpia.gigi.dbObjects.User;
import club.wpia.gigi.email.EmailProvider;
import club.wpia.gigi.ping.PingerDaemon;
import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
}
@Override
- public void clearMails() {
+ public void assertEmpty() {
mails.clear();
}
@Override
- public TestMail receive() {
+ public TestMail receive(String to) {
+ TestMail poll;
try {
- return mails.poll(30, TimeUnit.SECONDS);
+ poll = mails.poll(30, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw new Error(e);
}
+ if (poll == null) {
+ throw new AssertionError("Mail receiving timed out");
+ }
+ if (to != null) {
+ assertEquals(to, poll.getTo());
+ }
+ return poll;
}
@Override
}
@Override
- public TestMail poll() {
+ public TestMail poll(String to) {
throw new Error("Currently unimplemented");
}