HasMimeTypeParameter extends GenericMatcher { @Override public void init() throws MessagingException { filteredMimeTypeParameters = parseConfigurationString(Optional.ofNullable(getCondition())); }  @Override void init(); @Override Collection<MailAddress> match(Mail mail);  }
@Test void shouldThrowWhenConditionHasNoEquals() { assertThatThrownBy(() -> matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition("abc") .build())) .isInstanceOf(MailetException.class); }
@Test void shouldThrowWhenConditionHasNoValue() { assertThatThrownBy(() -> matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition("abc=") .build())) .isInstanceOf(MailetException.class); }
@Test void shouldThrowWhenConditionHasNoName() { assertThatThrownBy(() -> matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition("=abc") .build())) .isInstanceOf(MailetException.class); }
@Test void shouldSupportEqualsInValue() throws MessagingException { matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition("abc=123,def==--") .build()); assertThat(matcher.filteredMimeTypeParameters).contains(Pair.of("def", "=--")); }