### Question:
JobInstancesMojo extends BatchEEMojoBase { @Override public void execute() throws MojoExecutionException, MojoFailureException { final List<JobInstance> jobInstances = getOrCreateOperator().getJobInstances(jobName, start, count); getLog().info("Job instances (" + jobInstances.size() + "):"); for (final JobInstance instance : jobInstances) { getLog().info(" - #" + instance.getInstanceId() + " -> " + instance.getJobName()); } }  @Override void execute();  }### Answer:
@Test public void list() throws Exception { final JobInstancesMojo mojo = mojo(JobInstancesMojo.class, "jobName", "simple"); final long id = mojo.getOrCreateOperator().start("simple", null); waitForEnd(mojo.getOrCreateOperator(), id); mojo.count = 10; mojo.execute(); final String output = BatchEEMojoTestFactory.output(mojo).toLowerCase(Locale.ENGLISH); assertTrue(output.contains("job instances")); assertTrue(output.contains("#0 -> simple")); }