### Question:
JobNamesMojo extends BatchEEMojoBase { @Override public void execute() throws MojoExecutionException, MojoFailureException { final Set<String> names = getOrCreateOperator().getJobNames(); getLog().info("Job names (" + names.size() + "):"); for (final String name : names) { getLog().info(" - " + name); } }  @Override void execute();  }### Answer:
@Test public void noJobNames() throws Exception { assertTrue(execute(JobNamesMojo.class).toLowerCase(Locale.ENGLISH).contains("job names (0)")); }
@Test public void aJobName() throws Exception { final JobNamesMojo mojo = mojo(JobNamesMojo.class); final JobOperator operator = mojo.getOrCreateOperator(); waitForEnd(operator, operator.start("simple", null)); waitForEnd(operator, operator.start("simple-2", null)); mojo.execute(); final String output = output(mojo); assertTrue(output.toLowerCase(Locale.ENGLISH).contains("job names (2)")); assertTrue(output.toLowerCase(Locale.ENGLISH).contains("simple")); assertTrue(output.toLowerCase(Locale.ENGLISH).contains("simple2")); }