@Test public void executeOnTerraformOperationWithStringReturnValueWritesToInfoLog() throws TerraformException, MojoFailureException, MojoExecutionException { Mockito.when(terraformOperation.execute(Mockito.any())).thenReturn("Testing!"); TerraformMojo<String> terraformMojo = new TerraformMojo<String>() { @Override @SuppressWarnings("unchecked") public void execute() throws MojoExecutionException, MojoFailureException { execute((TerraformOperation<String>)terraformOperation, properties); } }; terraformMojo.execute(); Mockito.verify(terraformOperation, Mockito.times(1)).execute(properties); }
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); } }    }