### Question:
FoAggregateSink extends FoSink { public void figureGraphics( String name ) { figureGraphics( name, null ); } FoAggregateSink( Writer writer ); void head(); void head( SinkEventAttributes attributes ); void head_(); void title(); void title( SinkEventAttributes attributes ); void title_(); void author(); void author( SinkEventAttributes attributes ); void author_(); void date(); void date( SinkEventAttributes attributes ); void date_(); void body(); void body( SinkEventAttributes attributes ); void body_(); void setDocumentTitle( String title ); void setDocumentName( String name ); void setDocumentModel( DocumentModel model ); void setDocumentModel( DocumentModel model, int tocPos ); void figureGraphics( String name ); void figureGraphics( String src, SinkEventAttributes attributes ); void anchor( String name ); void anchor( String name, SinkEventAttributes attributes ); void link( String name ); void link( String name, SinkEventAttributes attributes ); void toc(); void coverPage(); static final int TOC_NONE; static final int TOC_START; static final int TOC_END; }### Answer:
@Test public void testFigureGraphics() { try { sink = new FoAggregateSink( writer ); sink.setDocumentName( "./folder\\docName.xml" ); sink.figureGraphics( "./../images/fig.png", null ); } finally { sink.close(); } String expected = "<fo:external-graphic src=\"./images/fig.png\" " + "content-width=\"scale-down-to-fit\" " + "content-height=\"scale-down-to-fit\" " + "height=\"100%\" " + "width=\"100%\"/>" + Markup.EOL; String actual = writer.toString(); assertThat ( wrapXml( actual ), isIdenticalTo( wrapXml( expected ) )); }