### Question:
DefaultContentParser implements ContentParser { @Override public XDOM parse(String content, Syntax syntax) throws ParseException, MissingParserException { return getParser(syntax).parse(new StringReader(content == null ? "" : content)); }  @Override XDOM parse(String content, Syntax syntax); @Override XDOM parse(String content, Syntax syntax, EntityReference source);  }### Answer:
@Test public void parseHasNoMetadataSource() throws Exception { XDOM xdom = mocker.getComponentUnderTest().parse("", Syntax.PLAIN_1_0); assertThat(xdom.getMetaData().getMetaData(MetaData.SOURCE), nullValue()); }
@Test public void parseIsAddingMetadataSource() throws Exception { XDOM xdom = mocker.getComponentUnderTest().parse("", Syntax.PLAIN_1_0, DOCUMENT_REFERENCE); assertThat(xdom.getMetaData().getMetaData(MetaData.SOURCE), equalTo(SOURCE)); }
@Test public void parseWhenNoParser() throws Exception { thrown.expect(MissingParserException.class); thrown.expectMessage("Failed to find a parser for syntax [XWiki 2.1]"); thrown.expectCause(any(ComponentLookupException.class)); mocker.getComponentUnderTest().parse("", Syntax.XWIKI_2_1, DOCUMENT_REFERENCE); }
@Test public void parseWhenNullSource() throws Exception { XDOM xdom = mocker.getComponentUnderTest().parse(null, Syntax.PLAIN_1_0); assertEquals(0, xdom.getChildren().size()); }