### Question:
RREvaluateMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { try (final SearchPlatform platform = buildSearchPlatform()) { final MetricClassManager metricClassManager = MetricClassConfigurationManager.getInstance() .setDefaultMaximumGrade(maximumGrade) .setDefaultMissingGrade(missingGrade) .buildMetricClassManager(metrics, parameterizedMetrics); final Engine engine = new Engine( platform, configurationsFolder, corporaFolder, ratingsFolder, templatesFolder, metricClassManager, fields.split(","), exclude, include, checksumFile, persistence, evaluation); engine.evaluate(searchPlatformConfiguration); } catch (final IOException exception) { throw new MojoExecutionException(exception.getMessage(), exception); } }  @Override void execute();  }### Answer:
@Test public void throwsMojoException_whenSearchPlatformNotFound() throws Exception { Mojo mojo = rule.lookupMojo("evaluate", "src/test/resources/evaluateMojoTests/bad_searchplatform_pom.xml"); assertNotNull(mojo); try { mojo.execute(); fail("Expected MojoExecutionException"); } catch (MojoExecutionException e) { assertTrue(e.getCause() instanceof ClassNotFoundException); } }
@Test public void throwsMojoException_whenSearchPlatformCannotBeConstructed() throws Exception { Mojo mojo = rule.lookupMojo("evaluate", "src/test/resources/evaluateMojoTests/searchplatform_args_constructor_pom.xml"); assertNotNull(mojo); try { mojo.execute(); fail("Expected MojoExecutionException"); } catch (MojoExecutionException e) { assertTrue(e.getCause() instanceof InstantiationException); } }