@Test
public void testExecute() throws Exception {

    final File testOutDir = new File(testOutBaseDir, "testExecute");
    FileUtils.deleteDirectory(testOutDir);
    OpearPlanMojo mojo = newMojo();
    final MavenProject project = mock(MavenProject.class);
    mojo.project = project;
    final Build build = mock(Build.class);
    when(project.getBuild()).thenReturn(build);
    final File classes = new File(testOutDir, "classes");
    when(build.getOutputDirectory()).thenReturn(classes.getPath());
    final MavenSession session = mock(MavenSession.class);
    mojo.session = session;
    final MavenExecutionRequest executionRequest = mock(MavenExecutionRequest.class);
    when(session.getRequest()).thenReturn(executionRequest);
    final RepositorySystem repositorySystem = mock(RepositorySystem.class);
    mojo.repositorySystem = repositorySystem;
    mojo.planParams = new PlanParams();
    mojo.planParams.setChecklists(Arrays.asList("checklist1", "checklist2"));
    mojo.planFile = new File(testOutDir, "opear-plans/plan.json");
    mojo.execute();
    try (Reader reader = new InputStreamReader(new FileInputStream(mojo.planFile), StandardCharsets.UTF_8);
         JsonReader jsonReader = Json.createReader(reader)) {
        final JsonObject readObject = jsonReader.readObject();
        assertEquals("expect json", key("checklists", arr("checklist1", "checklist2")).get(), readObject);
    }
}