@Test
public void testCopyPlans() throws Exception {

    final File testOutDir = new File(testOutBaseDir, "testCopyPlans");
    FileUtils.deleteDirectory(testOutDir);
    testOutDir.mkdirs();
    final File copyTarget = new File(testOutDir, "copied");
    copyTarget.mkdirs();
    final String expectFilename = "sample-plan.json";
    final URL samplePlanUrl = new File(srcDir, expectFilename).toURI().toURL();
    final Result<OakpalPlan> simplePlan = OakpalPlan.fromJson(samplePlanUrl);
    Result<Map<String, OakpalPlan>> copyResult = OpearPackageMojo.copyPlans(copyTarget,
            Arrays.asList(simplePlan.getOrDefault(null)));
    assertTrue("is success " + copyResult, copyResult.isSuccess());
    Map<String, OakpalPlan> copyMap = copyResult.getOrDefault(Collections.emptyMap());
    assertTrue("contains key: " + copyMap.keySet(),
            copyMap.containsKey(expectFilename));
    final File destFile = new File(copyTarget, expectFilename);
    assertTrue("file exists: " + destFile, destFile.isFile());
}