@Test
public void testBuilder_withArchiveRoot() throws Exception {

    final File testBase = new File(testOutDir, "testBuilder_withArchiveRoot");
    final File archiveSrc = new File("src/test/resources/filevault/noReferences");
    final File archiveRoot = new File(testBase, "noReferences");
    FileUtils.deleteDirectory(archiveRoot);
    FileUtils.copyDirectory(archiveSrc, archiveRoot);
    final JcrNs fooNs = JcrNs.create("foo", "http://foo.com");
    final List<JcrNs> jcrNs = Collections.singletonList(fooNs);
    final NamespaceMapping mapping = JsonCnd.toNamespaceMapping(jcrNs);
    WebsterPlan.Builder builder = new WebsterPlan.Builder();
    builder.withFixtureProvider(() -> {
        final NodeStoreFixture fixture = JcrFactory.getNodeStoreFixture(true, "memory");
        new OakMachine.Builder().withNodeStoreSupplier(fixture::getStore).withInitStage(
                new InitStage.Builder()
                        .withNs(jcrNs)
                        .withQNodeTypes(JsonCnd.getQTypesFromJson(obj().key("foo:mixin", obj().key("@", arr("mixin"))).get(), mapping))
                        .withForcedRoot("/foo", "nt:folder", "foo:mixin")
                        .build()).build().scanPackage();
        return fixture;
    });
    final CompletableFuture<File> slot = new CompletableFuture<>();
    final ArchiveAwareTarget target = mock(ArchiveAwareTarget.class);
    doAnswer(call -> slot.complete(call.getArgument(1, File.class)))
            .when(target).setArchive(any(Archive.class), any(File.class));
    builder.withArchiveRoot(archiveRoot);
    builder.withTarget(target);
    builder.build().perform();
    assertSame("should be same as archiveRoot", archiveRoot, slot.getNow(null));
}