@Test void initShouldThrowExceptionWhenUrlPrefixIsAbsent() { FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .mailetName("Test") .build(); assertThatThrownBy(() -> mailet.init(mailetConfig)) .isInstanceOf(MessagingException.class); }
@Override public void init() throws MessagingException { urlPrefix = Optional.ofNullable(getInitParameter(URL_PREFIX)) .map(MailRepositoryUrl::from) .orElseThrow(() -> new MessagingException("'urlPrefix' is a mandatory configuration property")); passThrough = getInitParameter(PASS_THROUGH, DEFAULT_CONSUME); allowRepositoryCreation = getInitParameter(ALLOW_REPOSITORY_CREATION, DEFAULT_ALLOW_REPOSITORY_CREATION); }
ToSenderDomainRepository extends GenericMailet { @Override public void init() throws MessagingException { urlPrefix = Optional.ofNullable(getInitParameter(URL_PREFIX)) .map(MailRepositoryUrl::from) .orElseThrow(() -> new MessagingException("'urlPrefix' is a mandatory configuration property")); passThrough = getInitParameter(PASS_THROUGH, DEFAULT_CONSUME); allowRepositoryCreation = getInitParameter(ALLOW_REPOSITORY_CREATION, DEFAULT_ALLOW_REPOSITORY_CREATION); } }
ToSenderDomainRepository extends GenericMailet { @Override public void init() throws MessagingException { urlPrefix = Optional.ofNullable(getInitParameter(URL_PREFIX)) .map(MailRepositoryUrl::from) .orElseThrow(() -> new MessagingException("'urlPrefix' is a mandatory configuration property")); passThrough = getInitParameter(PASS_THROUGH, DEFAULT_CONSUME); allowRepositoryCreation = getInitParameter(ALLOW_REPOSITORY_CREATION, DEFAULT_ALLOW_REPOSITORY_CREATION); } @Inject  ToSenderDomainRepository(MailRepositoryStore mailRepositoryStore); }
ToSenderDomainRepository extends GenericMailet { @Override public void init() throws MessagingException { urlPrefix = Optional.ofNullable(getInitParameter(URL_PREFIX)) .map(MailRepositoryUrl::from) .orElseThrow(() -> new MessagingException("'urlPrefix' is a mandatory configuration property")); passThrough = getInitParameter(PASS_THROUGH, DEFAULT_CONSUME); allowRepositoryCreation = getInitParameter(ALLOW_REPOSITORY_CREATION, DEFAULT_ALLOW_REPOSITORY_CREATION); } @Inject  ToSenderDomainRepository(MailRepositoryStore mailRepositoryStore); @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo(); }
ToSenderDomainRepository extends GenericMailet { @Override public void init() throws MessagingException { urlPrefix = Optional.ofNullable(getInitParameter(URL_PREFIX)) .map(MailRepositoryUrl::from) .orElseThrow(() -> new MessagingException("'urlPrefix' is a mandatory configuration property")); passThrough = getInitParameter(PASS_THROUGH, DEFAULT_CONSUME); allowRepositoryCreation = getInitParameter(ALLOW_REPOSITORY_CREATION, DEFAULT_ALLOW_REPOSITORY_CREATION); } @Inject  ToSenderDomainRepository(MailRepositoryStore mailRepositoryStore); @Override void init(); @Override void service(Mail mail); @Override String getMailetInfo(); static final String URL_PREFIX; static final String PASS_THROUGH; static final String ALLOW_REPOSITORY_CREATION; }