@Test
    void testExportThenImport() throws IOException {

        final ExplorerNode systemNode = explorerNodeService.getRoot();
        final DocRef systemDocRef = systemNode != null
                ? systemNode.getDocRef()
                : null;
        assertThat(explorerNodeService.getDescendants(systemDocRef).size()).isEqualTo(1);

        // GitRepo
        final ExplorerNode gitRepoNode = explorerService.create(GitRepoDoc.TYPE,
                "GitRepo",
                systemNode,
                null);
        GitRepoDoc gitRepoDoc = gitRepoStore.readDocument(gitRepoNode.getDocRef());
        gitRepoDoc.setDescription("GitRepo Description");
        gitRepoStore.writeDocument(gitRepoDoc);

        final ExplorerNode folder1 = explorerService.create(ExplorerConstants.FOLDER_TYPE,
                "folder1",
                gitRepoNode,
                null);
        final ExplorerNode folder2 = explorerService.create(ExplorerConstants.FOLDER_TYPE,
                "folder2",
                gitRepoNode,
                null);

        assertThat(explorerNodeService.getDescendants(systemDocRef).size()).isEqualTo(4);

        final ExplorerNode pipelineNode = explorerService.create(PipelineDoc.TYPE,
                "Pipeline",
                folder2,
                null);
        final PipelineDoc pipelineDoc = pipelineStore.readDocument(pipelineNode.getDocRef());
        pipelineDoc.setDescription("Pipeline Description");
        pipelineStore.writeDocument(pipelineDoc);

        // Something under the GitRepo to export
        final ExplorerNode feedNode = explorerService.create(FeedDoc.TYPE,
                "FEED",
                folder1,
                null);
        final FeedDoc feedDoc = feedStore.readDocument(feedNode.getDocRef());
        feedDoc.setDescription("Feed Description");
        feedStore.writeDocument(feedDoc);

        commonTestControl.createRequiredXMLSchemas();

        final Path testDataDir = getCurrentTestDir().resolve("ExportGitRepoTest");
        LOGGER.info("Writing to test dir: {}", testDataDir);

        FileUtil.deleteDir(testDataDir);
        Files.createDirectories(testDataDir);

        // List of paths to remove from the exported paths
        // Basically the path to the GitRepoDoc node
        List<ExplorerNode> rootNodePath = List.of(ExplorerConstants.SYSTEM_NODE, gitRepoNode);

        // List of nodes to export.
        Set<DocRef> docRefsToExport = Set.of(
                gitRepoDoc.asDocRef(),
                feedNode.getDocRef(),
                pipelineNode.getDocRef());

        // List of doctypes to ignore - GitRepos so we ignore recursive repos
        Set<String> docTypesToIgnore = Set.of(GitRepoDoc.TYPE);

        // Run the export to disk
        importExportSerializer.write(
                rootNodePath,
                testDataDir,
                docRefsToExport,
                docTypesToIgnore,
                true);

        List<String> pathPatterns = List.of(
                "",
                "folder1",
                "folder1/FEED\\.Feed\\.[-a-f0-9]*.meta",
                "folder1/FEED\\.Feed\\.[-a-f0-9]*.node",
                "folder2",
                "folder2/Pipeline\\.Pipeline\\.[-a-f0-9]*.meta",
                "folder2/Pipeline\\.Pipeline\\.[-a-f0-9]*.node",
                "folder2/Pipeline\\.Pipeline\\.[-a-f0-9]*.xml");

        this.testGitFilesOnDisk("testExport2",
                testDataDir,
                pathPatterns);

        // Remove all entries from the database
        commonTestControl.clear();

        // GitRepo
        final ExplorerNode gitRepoNode2 = explorerService.create(GitRepoDoc.TYPE,
                "GitRepo",
                systemNode,
                null);
        GitRepoDoc gitRepoDoc2 = gitRepoStore.readDocument(gitRepoNode2.getDocRef());
        gitRepoDoc2.setDescription("GitRepo Description");
        gitRepoStore.writeDocument(gitRepoDoc2);

        List<ImportState> importStates = new ArrayList<>();
        ImportSettings importSettings = ImportSettings.builder()
                .importMode(ImportMode.IGNORE_CONFIRMATION)
                .enableFilters(false)
                .useImportFolders(true)
                .useImportNames(true)
                .rootDocRef(gitRepoNode2.getDocRef())
                .build();
        importExportSerializer.read(testDataDir, importStates, importSettings);

        var folder12 = this.explorerNodeService.getNodesByName(gitRepoNode2, "folder1");
        assertThat(folder12)
                .as("GitRepo node has folder1 child")
                .isNotEmpty()
                .hasSize(1);
        var folder12node = folder12.getFirst();
        var feedNodeList = this.explorerNodeService.getNodesByName(folder12node, "FEED");
        assertThat(feedNodeList)
                .as("folder1 has a FEED child")
                .isNotEmpty()
                .hasSize(1);
        var folder22 = this.explorerNodeService.getNodesByName(gitRepoNode2, "folder2");
        assertThat(folder22)
                .as("GitRepo node has folder2 child")
                .isNotEmpty()
                .hasSize(1);
        var folder22node = folder22.getFirst();
        var pipelineNodeList = this.explorerNodeService.getNodesByName(folder22node, "Pipeline");
        assertThat(pipelineNodeList)
                .as("folder2 has a pipeline child")
                .isNotEmpty()
                .hasSize(1);


    }
Does the same as testExport1 but tries to import again.
@throws IOException If something goes really wrong
stroom-app/src/test/java/stroom/importexport/TestImportExportGitRepo.java