### Question:
AbandonMojo extends BatchEEMojoBase { @Override public void execute() throws MojoExecutionException, MojoFailureException { getOrCreateOperator().abandon(executionId); getLog().info("Abandonned job #" + executionId); }  @Override void execute();  }### Answer:
@Test public void abandon() throws Exception { final AbandonMojo mojo = mojo(AbandonMojo.class); final long id = mojo.getOrCreateOperator().start("simple", new Properties() {{ setProperty("sleep", "0"); }}); JobExecution jobExecution; do { jobExecution = mojo.getOrCreateOperator().getJobExecution(id); } while (!BatchStatus.COMPLETED.equals(jobExecution.getBatchStatus())); mojo.executionId = id; mojo.execute(); Batches.waitForEnd(id); final String output = BatchEEMojoTestFactory.output(mojo); assertEquals(BatchStatus.ABANDONED, mojo.getOrCreateOperator().getJobExecution(Long.parseLong(output.substring(output.lastIndexOf("#") + 1).trim())).getBatchStatus()); assertTrue(output.toLowerCase(Locale.ENGLISH).contains("abandonned")); }