}
@Override
- public void clearMails() {
+ public void assertEmpty() {
mails.clear();
}
@Override
- public TestMail receive() {
+ public TestMail receive(String to) {
TestMail poll;
try {
poll = mails.poll(30, TimeUnit.SECONDS);
if (poll == null) {
throw new AssertionError("Mail receiving timed out");
}
+ if (to != null) {
+ assertEquals(to, poll.getTo());
+ }
return poll;
}
}
@Override
- public TestMail poll() {
+ public TestMail poll(String to) {
throw new Error("Currently unimplemented");
}