### Question:
StartMojo extends JobActionMojoBase { @Override public void execute() throws MojoExecutionException { final JobOperator jobOperator = getOrCreateOperator(); final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); final ClassLoader loader = createStartLoader(oldLoader); Thread.currentThread().setContextClassLoader(loader); final long id; try { id = jobOperator.start(jobName, toProperties(jobParameters)); } finally { Thread.currentThread().setContextClassLoader(oldLoader); } getLog().info("Started job " + jobName + ", id is #" + id); if (wait) { waitEnd(jobOperator, id); } }  @Override void execute();  }### Answer:
@Test public void start() throws Exception { final StartMojo mojo = mojo(StartMojo.class, "jobName", "simple"); mojo.execute(); final String output = BatchEEMojoTestFactory.output(mojo); final long id = Long.parseLong(output.substring(output.lastIndexOf("#") + 1).trim()); waitForEnd(mojo.getOrCreateOperator(), id); assertNotNull(mojo.getOrCreateOperator().getJobExecution(id)); assertTrue(output.toLowerCase(Locale.ENGLISH).contains("started")); }