@Test
public void dispatchProcessing_selectionFigure_shouldWork() throws Exception {

    PowerMock.mockStatic(FigureTableVisualizer.class);
    File fakeFile = File.createTempFile("justForTheTest", "baomiao");
    fakeFile.deleteOnExit();
    expect(FigureTableVisualizer.annotateFigureAndTables(anyObject(), EasyMock.anyObject(),
            EasyMock.anyObject(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()))
            .andReturn(null);
    expect(documentSourceMock.getXmlFile()).andReturn(fakeFile);
    PowerMock.replay(FigureTableVisualizer.class);
    replay(documentSourceMock);
    target.dispatchProcessing(GrobidRestUtils.Annotation.FIGURE,
            null, documentSourceMock, null);
    PowerMock.verify(FigureTableVisualizer.class);
    verify(documentSourceMock);
}