QavMavenMojo extends AbstractMojo { @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("project", project) .append("useDefaultInputDirs", useDefaultInputDirs) .append("failOnError", failOnError) .append("analysisFilename", analysisFilename) .append("outputDir", outputDir) .toString(); }  @Override void execute(); void setProject(MavenProject project); void setUseDefaultInputDirs(boolean useDefaultInputDirs); void setFailOnError(boolean failOnError); void setAnalysisFilename(String analysisFilename); void setOutputDir(String outputDir); @Override String toString();  }
@Test public void testConfigure1() throws Exception { File testPom = new File(getBasedir(), "src/test/resources/test-pom-1.xml"); QavMavenMojo qavMavenMojo = (QavMavenMojo) lookupMojo("qav", testPom); assertThat(qavMavenMojo, notNullValue()); assertThat(qavMavenMojo.toString(), is("QavMavenMojo[project=<null>,useDefaultInputDirs=true,failOnError=false,analysisFilename=<null>,outputDir=<null>]")); }
@Test public void testConfigure2() throws Exception { File testPom = new File(getBasedir(), "src/test/resources/test-pom-2.xml"); QavMavenMojo qavMavenMojo = (QavMavenMojo) lookupMojo("qav", testPom); assertThat(qavMavenMojo, notNullValue()); assertThat(qavMavenMojo.toString(), is("QavMavenMojo[project=<null>,useDefaultInputDirs=true,failOnError=false,analysisFilename=qa/my.qav,outputDir=<null>]")); }
@Test public void testConfigure3() throws Exception { File testPom = new File(getBasedir(), "src/test/resources/test-pom-3.xml"); QavMavenMojo qavMavenMojo = (QavMavenMojo) lookupMojo("qav", testPom); assertThat(qavMavenMojo, notNullValue()); assertThat(qavMavenMojo.toString(), is("QavMavenMojo[project=<null>,useDefaultInputDirs=false,failOnError=true,analysisFilename=qa/my-own.qav,outputDir=target/qav-report]")); }