@Test
public void testSimple() throws Exception {

    Metadata metadata = new Metadata();
    InputStream stream = getStream("test-documents/testRFC822");
    ContentHandler handler = mock(DefaultHandler.class);
    try {
        EXTRACT_ALL_ALTERNATIVES_PARSER.parse(stream, handler, metadata, new ParseContext());
        verify(handler).startDocument();
        //just one body
        verify(handler).startElement(eq(XHTMLContentHandler.XHTML), eq("p"), eq("p"), any(Attributes.class));
        verify(handler).endElement(XHTMLContentHandler.XHTML, "p", "p");
        //no multi-part body parts
        verify(handler, never()).startElement(eq(XHTMLContentHandler.XHTML), eq("div"), eq("div"), any(Attributes.class));
        verify(handler, never()).endElement(XHTMLContentHandler.XHTML, "div", "div");
        verify(handler).endDocument();
        //note no leading spaces, and no quotes
        assertEquals("Julien Nioche (JIRA) <jira@apache.org>", metadata.get(TikaCoreProperties.CREATOR));
        assertEquals("[jira] Commented: (TIKA-461) RFC822 messages not parsed",
                metadata.get(TikaCoreProperties.TITLE));
        assertEquals("[jira] Commented: (TIKA-461) RFC822 messages not parsed",
                metadata.get(TikaCoreProperties.SUBJECT));
    } catch (Exception e) {
        fail("Exception thrown: " + e.getMessage());
    }
}