public String migrate(String oldJSON, int targetVersion) {
        LOGGER.debug("Migrating to version {}: {}", targetVersion, oldJSON);

        Chainr transform = getTransformerFor(targetVersion);
        Object transformedObject = transform.transform(JsonUtils.jsonToMap(oldJSON), getContextMap(targetVersion));
        String transformedJSON = JsonUtils.toJsonString(transformedObject);


        LOGGER.debug("After migration to version {}: {}", targetVersion, transformedJSON);
        return transformedJSON;
    }
@Test
    void shouldMigrateV1ToV2_ByChangingEnablePipelineLockingTrue_To_LockBehaviorLockOnFailure() {
        ConfigRepoDocumentMother documentMother = new ConfigRepoDocumentMother();
        String oldJSON = documentMother.versionOneWithLockingSetTo(true);
        String transformedJSON = migrator.migrate(oldJSON, 2);

        assertThatJson(transformedJSON).node("target_version").isEqualTo("\"2\"");
        assertThatJson(transformedJSON).node("pipelines[0].name").isEqualTo("firstpipe");
        assertThatJson(transformedJSON).node("pipelines[0].lock_behavior").isEqualTo("lockOnFailure");
        assertThatJson(transformedJSON).node("errors").isArray().ofLength(0);
    }