MimeMessageTransformer { public ProvideAndRegisterDocumentSetRequestType transform(MimeMessage message) { ProvideAndRegisterDocumentSetRequestType request; try { request = transformer.transform(message); } catch (TransformationException e) { LOG.error(ERROR_MESSAGE, e); throw new DirectException(ERROR_MESSAGE, e); } return request; } MimeMessageTransformer(); ProvideAndRegisterDocumentSetRequestType transform(MimeMessage message);  }
@Test public void usingRFC5322() throws MessagingException { MimeMessageTransformer transformer = getMimeMessageTransformer(); MimeMessage message = buildMimeMessage("Example_A.txt"); ProvideAndRegisterDocumentSetRequestType result = transformer.transform(message); verifyMime(result, 1); }
@Test public void usingRFC5322PlusMime() throws MessagingException { MimeMessageTransformer transformer = getMimeMessageTransformer(); MimeMessage message = buildMimeMessage("Example_B.txt"); ProvideAndRegisterDocumentSetRequestType result = transformer.transform(message); verifyMime(result, 1); }
@Test public void usingRFC5322PlusXdm() throws IOException { MimeMessageTransformer transformer = getMimeMessageTransformer(); MimeMessage message = buildXdmMessage(); ProvideAndRegisterDocumentSetRequestType result = transformer.transform(message); verifyXdm(result, 2); }