    @Test
    public void testVersionReplacement() throws Exception {

        File outDir = Tests.copyPackageSources(getClass());

        LOG.info("Updating poms in " + outDir);

        File[] files = outDir.listFiles();
        assertNotNull("No output files!", files);
        assertTrue("No output files!", files.length > 0);

        List<PomUpdateStatus> pomsToChange = new ArrayList<>();

        for (File file : files) {
            try {
                PomUpdateStatus pomUpdateStatus = PomUpdateStatus.createPomUpdateStatus(file);
                pomUpdateStatus.setRootPom(true);
                pomsToChange.add(pomUpdateStatus);
            } catch (Exception e) {
                fail("Failed to parse " + file, e);
            }
        }


        Map<String, String> propertyVersions = new HashMap<>();
        propertyVersions.put("assertj.version", assertJVersion);
        propertyVersions.put("fabric8.maven.plugin.version", fmpVersion);
        propertyVersions.put("fabric8.version", fabric8Version);
        propertyVersions.put("spring-boot.version", springBootVersion);

        // lets add some changes
        List<DependencyVersionChange> changes = new ArrayList<>();
        changes.add(new MavenDependencyVersionChange("io.fabric8:fabric8-maven-plugin", fmpVersion, MavenScopes.PLUGIN, true, ElementProcessors.createFabric8MavenPluginElementProcessor()));

        changes.add(new DependencyVersionChange(Kind.MAVEN, "org.assertj:assertj-core", assertJVersion, MavenScopes.ARTIFACT));

        // BOM dependencies
        changes.add(new DependencyVersionChange(Kind.MAVEN, "io.fabric8:fabric8-project-bom-with-platform-deps", fabric8Version, MavenScopes.ARTIFACT));
        changes.add(new DependencyVersionChange(Kind.MAVEN, "org.springframework.boot:spring-boot-dependencies", springBootVersion, MavenScopes.ARTIFACT));

        PomHelper.updatePomVersions(pomsToChange, changes);

        for (File file : files) {
            Document doc;
            try {
                doc = parseXmlFile(file);
            } catch (Exception e) {
                fail("Failed to parse " + file + " due to " + e, e);
                continue;
            }

            assertPropertiesValid(file, doc, propertyVersions);
            assertChangesValid(file, doc, changes);
        }
    }