@Test public void testSuccess() throws MessagingException, IOException { sut = new MessageContentExtractor(Collections.singletonList(BASIC_MARKER), null); Message msg = (Message) makeMultipart( true, makeContentPart("text/plain", true, "Not this"), makeContentPart("text/plain", false, " \t\r\n \t \r\nFrom: blah"), makeMultipart( false, makeContentPart("text/plain", true, ""), makeContentPart("image/png", false, new byte[12]), makeContentPart("text/plain", true, "From: xyz"), makeMultipart(false, makeContentPart("text/html", false, "<head></head>"), makeContentPart("text/plain", false, TEXT_TO_FIND)), makeContentPart("text/plain", false, "Not this")), makeContentPart("text/plain", false, "Not this either"), makeContentPart("text/html", false, "<p>Not this</p>")); String result = sut.extract(msg); context.assertIsSatisfied(); assertEquals(TEXT_TO_FIND, result); }
public String extract(final Message message) throws MessagingException, IOException { return findAndExtract(message); }
MessageContentExtractor { public String extract(final Message message) throws MessagingException, IOException { return findAndExtract(message); } }
MessageContentExtractor { public String extract(final Message message) throws MessagingException, IOException { return findAndExtract(message); } MessageContentExtractor(final Collection<String> inReplyMarkersLiteral,
            final Collection<String> inReplyMarkersRegex); }
MessageContentExtractor { public String extract(final Message message) throws MessagingException, IOException { return findAndExtract(message); } MessageContentExtractor(final Collection<String> inReplyMarkersLiteral,
            final Collection<String> inReplyMarkersRegex); String extract(final Message message); }
MessageContentExtractor { public String extract(final Message message) throws MessagingException, IOException { return findAndExtract(message); } MessageContentExtractor(final Collection<String> inReplyMarkersLiteral,
            final Collection<String> inReplyMarkersRegex); String extract(final Message message);  }