ToProcessor extends GenericMailet { @Override public void init() throws MailetException { debug = isDebug(); processor = getInitParameter("processor"); if (processor == null) { throw new MailetException("processor parameter is required"); } noticeText = Optional.ofNullable(getInitParameter("notice")); }  @Override void init(); @Override String getMailetInfo(); @Override void service(Mail mail);  }
@Test void initShouldThrowWhenProcessorIsNotGiven() { FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .mailetName("Test") .mailetContext(mailContext) .setProperty("notice", "error in message") .build(); assertThatThrownBy(() -> mailet.init(mailetConfig)) .isInstanceOf(MailetException.class); }