### Question:
GenerateMojo extends AbstractMojo { List<String> getPackages() { return packages; }  void execute();  }### Answer:
@Test public void testBasic() throws Exception { File basedir = resources.getBasedir("basic"); GenerateMojo generate = (GenerateMojo) maven.lookupConfiguredMojo(maven.newMavenSession(maven.readMavenProject(basedir)), maven.newMojoExecution("generate")); assertThat(generate.getPackages()).containsOnly("com.test.model"); }
@Test public void testFull() throws Exception { File basedir = resources.getBasedir("full"); GenerateMojo generate = (GenerateMojo) maven.lookupConfiguredMojo(maven.newMavenSession(maven.readMavenProject(basedir)), maven.newMojoExecution("generate")); assertThat(generate.getPackages()).containsOnly("com.test.model", "com.test.entities"); }