AddSubjectPrefix extends GenericMailet { @Override public void init() throws MessagingException { subjectPrefix = getInitParameter("subjectPrefix"); if (Strings.isNullOrEmpty(subjectPrefix)) { throw new MessagingException("Please configure a valid subjectPrefix"); } }  @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo();  }
@Test void shouldThrowWhenEmptyPrefix() throws MessagingException { FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .mailetName("Test") .setProperty("subjectPrefix", "") .build(); assertThatThrownBy(() -> mailet.init(mailetConfig)) .isInstanceOf(MessagingException.class); }