ActionReject rejection = runRejectScript(script);
assertEquals(lineOne + lineTwo + lineThree + lineFour + lineFive, rejection.getMessage());
}
private ActionReject runRejectScript(String script) throws SieveException, ParseException {
MailAdapter mail = JUnitUtils.createMail();
JUnitUtils.interpret(mail, script);
assertTrue(mail.getActions().size() == 1);
Object action = mail.getActions().get(0);
assertTrue(action instanceof ActionReject);
ActionReject rejection = (ActionReject) action;
return rejection;
}