@Test
public void testShrinkWrapPlans() throws Exception {

    final File testOutDir = new File(testOutBaseDir, "testShrinkWrapPlans");
    FileUtils.deleteDirectory(testOutDir);
    testOutDir.mkdirs();
    final File copyTarget = new File(testOutDir, "copied");
    copyTarget.mkdirs();
    final String preInstallFilename = "tmp_foo_bar.zip";
    final File preInstallPackage = TestPackageUtil.prepareTestPackage(preInstallFilename);
    final OpearPackageMojo mojo = newMojo();
    final MavenProject project = mock(MavenProject.class);
    mojo.project = project;
    final String expectFilename = "sample-plan.json";
    final File samplePlanFile = new File(srcDir, expectFilename);
    mojo.planFile = samplePlanFile;
    final int addPlans = 10;
    for (int i = 0; i < addPlans; i++) {
        mojo.additionalPlans.add(samplePlanFile);
    }
    List<String> expectedPlanNames = new ArrayList<>();
    expectedPlanNames.add(expectFilename);
    for (int i = 0; i < addPlans; i++) {
        expectedPlanNames.add("sample-plan_" + (i+1) + ".json");
    }
    Result<List<String>> planNamesResult = mojo.shrinkWrapPlans(copyTarget);
    assertTrue("is success: " + planNamesResult, planNamesResult.isSuccess());
    assertEquals("expect plan names",
            expectedPlanNames,
            planNamesResult.getOrDefault(Collections.emptyList()));
    assertTrue("preinstall is file", new File(copyTarget, preInstallFilename).isFile());
    File[] otherZips = copyTarget.listFiles((dir, name) -> !preInstallFilename.equals(name) && name.endsWith(".zip"));
    assertNotNull("other zips should not be null", otherZips);
    assertEquals("other zips should be empty", 0, otherZips.length);
}