@Test
public void executeIfRuntimeException() {

    final Capture capture = new Capture();
    final RuntimeException exception = new RuntimeException();
    final DynamicScopeContext context = mockContext.getMock();
    webScraper.execute(same(context));
    expectLastCall().andThrow(exception);
    eventBus.post(isA(ScraperExecutionErrorEvent.class));
    expectLastCall().andAnswer(new IAnswer<Object>() {
        public Object answer() throws Throwable {
            capture.setCaptured(getCurrentArguments()[0]);
            return null;
        }
    });
    EasyMockUnitils.replay();
    wrapper.execute(context);
    final ScraperExecutionErrorEvent event =
        capture.<ScraperExecutionErrorEvent>getCaptured();
    assertNotNull("Event is null.", event);
    final Exception ex = event.getException();
    assertNotNull("Exception from event is null.", ex);
    assertSame("Unexpected exception.", exception, ex);
}