@Test(expected = MojoExecutionException.class) public void terraformExceptionIsThrownAsMojoExecutionException() throws TerraformException, MojoExecutionException, MojoFailureException { Mockito.when(terraformOperation.execute(Mockito.any())).thenThrow(new TerraformException("boom!")); TerraformMojo terraformMojo = new TerraformMojo() { @Override public void execute() throws MojoExecutionException, MojoFailureException { execute(terraformOperation, properties); } }; terraformMojo.execute(); }
protected final void execute(TerraformOperation<T> tfOperation, Properties properties) throws MojoExecutionException { try { tfOperation.execute(properties); } catch (TerraformException e) { throw new MojoExecutionException("Failed to execute terraform operation", e); } }
TerraformMojo extends AbstractMojo { protected final void execute(TerraformOperation<T> tfOperation, Properties properties) throws MojoExecutionException { try { tfOperation.execute(properties); } catch (TerraformException e) { throw new MojoExecutionException("Failed to execute terraform operation", e); } } }
TerraformMojo extends AbstractMojo { protected final void execute(TerraformOperation<T> tfOperation, Properties properties) throws MojoExecutionException { try { tfOperation.execute(properties); } catch (TerraformException e) { throw new MojoExecutionException("Failed to execute terraform operation", e); } }  }
TerraformMojo extends AbstractMojo { protected final void execute(TerraformOperation<T> tfOperation, Properties properties) throws MojoExecutionException { try { tfOperation.execute(properties); } catch (TerraformException e) { throw new MojoExecutionException("Failed to execute terraform operation", e); } }   }
TerraformMojo extends AbstractMojo { protected final void execute(TerraformOperation<T> tfOperation, Properties properties) throws MojoExecutionException { try { tfOperation.execute(properties); } catch (TerraformException e) { throw new MojoExecutionException("Failed to execute terraform operation", e); } }    }