public static final class ExceptionThrowingWroManagerFactory
extends DefaultStandaloneContextAwareManagerFactory {
@Override
protected ProcessorsFactory newProcessorsFactory() {
final SimpleProcessorsFactory factory = new SimpleProcessorsFactory();
final ResourcePostProcessor postProcessor = Mockito.mock(ResourcePostProcessor.class);
try {
Mockito.doThrow(new RuntimeException()).when(postProcessor).process(Mockito.any(Reader.class),
Mockito.any(Writer.class));
} catch (final IOException e) {
Assert.fail("never happen");
}
factory.addPostProcessor(postProcessor);
return factory;
}