### Question:
DependencyMediatorMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (isSkip()) { getLog().info(project.getArtifactId() + " skipped compatible checking"); return; } doExecute(); }  boolean isSkip(); void execute();  }### Answer:
@Test public void testMojoExecution() throws Exception { File testPom = getTestFile("src/test/resources/unit/pom.xml"); assertNotNull(testPom); assertTrue(testPom.exists()); DependencyMediatorMojo myMojo = (DependencyMediatorMojo) lookupMojo("check", testPom); assertNotNull(myMojo); myMojo.execute(); }