@Test public void exceptionInEchoShouldBeConverted() throws Exception { EchoPlugin echoPlugin = mock(EchoPlugin.class); doThrow(new FailureException("Gurka")).when(echoPlugin).echo(); new ReflectionHelper(echoMojo).setField(echoPlugin); expectedException.expect(MojoFailureException.class); expectedException.expectMessage(is("Gurka")); echoMojo.echo(); }
void echo() throws MojoFailureException { try { echoPlugin.echo(); } catch (FailureException fex) { new ExceptionHandler(fex).throwMojoFailureException(); } }
EchoMojo extends AbstractMojo { void echo() throws MojoFailureException { try { echoPlugin.echo(); } catch (FailureException fex) { new ExceptionHandler(fex).throwMojoFailureException(); } } }
EchoMojo extends AbstractMojo { void echo() throws MojoFailureException { try { echoPlugin.echo(); } catch (FailureException fex) { new ExceptionHandler(fex).throwMojoFailureException(); } }  }
EchoMojo extends AbstractMojo { void echo() throws MojoFailureException { try { echoPlugin.echo(); } catch (FailureException fex) { new ExceptionHandler(fex).throwMojoFailureException(); } }  @Override void execute(); }
EchoMojo extends AbstractMojo { void echo() throws MojoFailureException { try { echoPlugin.echo(); } catch (FailureException fex) { new ExceptionHandler(fex).throwMojoFailureException(); } }  @Override void execute();  }