WithStorageDirective extends GenericMailet { @Override public void init() throws MessagingException { targetFolderName = AttributeValue.of(validateMailetConfiguration(TARGET_FOLDER_NAME)); } @Inject  WithStorageDirective(UsersRepository usersRepository); @Override void init(); @Override void service(Mail mail); ThrowingConsumer<MailAddress> addStorageDirective(Mail mail); static final String TARGET_FOLDER_NAME; }
@Test public void initShouldThrowWhenNoTargetFolderEntry() { assertThatThrownBy(() -> testee.init(FakeMailetConfig.builder() .build())) .isInstanceOf(IllegalStateException.class); }
@Test public void initShouldThrowWhenEmptyTargetFolderEntry() { assertThatThrownBy(() -> testee.init(FakeMailetConfig.builder() .setProperty(WithStorageDirective.TARGET_FOLDER_NAME, "") .build())) .isInstanceOf(IllegalStateException.class); }