@Test
public void Should_MessagePartCreatorsCreateTextAndFileParts()
        throws Exception {

    IObject context = new DSObject();
    SMTPMessageAdaptor messageAdaptor = mock(SMTPMessageAdaptor.class);
    List<IObject> partsParameters = Collections.singletonList(
            new DSObject("{\"type\":\"text\",\"mime\":\"text/html\",\"text\":\"TeXt\"}"));
    ArgumentMatcher<MimeBodyPart> partMatcher = new ArgumentMatcher<MimeBodyPart>() {
        @Override
        public boolean matches(Object o) {
            MimeBodyPart part = (MimeBodyPart)o;
            try {
                return part.getDataHandler().getContentType().equals("text/html") && part.getContent().equals("TeXt");
            } catch (MessagingException | IOException e) {
                return false;
            }
        }
    };
    MessagePartCreators.addAllPartsTo(messageAdaptor, context, partsParameters);
    verify(messageAdaptor).addPart(argThat(partMatcher));
}