@Test
public void testBuilder_perform_withGlobalSegment() throws Exception {

    final File globalStore = new File(testOutDir, "testBuilder_perform_withGlobalSegment/segmentstore");
    if (globalStore.exists()) {
        FileUtils.deleteDirectory(globalStore);
    }
    WebsterPlan.Builder builder = new WebsterPlan.Builder();
    builder.withGlobalSegmentStore(globalStore);
    final JcrNs fooNs = JcrNs.create("foo", "http://foo.com");
    final List<JcrNs> jcrNs = Collections.singletonList(fooNs);
    final NamespaceMapping mapping = JsonCnd.toNamespaceMapping(jcrNs);
    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 File targetFile = new File(testOutDir, "testBuilder_perform_withGlobalSegment.json");
    if (targetFile.exists()) {
        targetFile.delete();
    }
    builder.withTarget(JsonTargetFactory.CHECKLIST.createTarget(targetFile,
            obj().key("selectPaths", arr().val("/foo")).get()));
    builder.build().perform();
}