MavenEchoOutput implements EchoOutput { @Override public void fail(String content) { this.throwAsUnchecked(new MojoFailureException(content)); } MavenEchoOutput(Log wrappedLog); @Override void fail(String content); @Override void error(String content); @Override void warning(String content); @Override void info(String content); @Override void debug(String content);  }
@Test public void failLevelShouldThrowException() { expectedException.expect(MojoFailureException.class); expectedException.expectMessage("Gurkas"); mavenEchoOutput.fail("Gurkas"); }