// Path: core/presentation/src/main/java/org/hesperides/core/presentation/io/platforms/properties/PropertiesIO.java
// @Value
// @AllArgsConstructor
// public class PropertiesIO {
// 
//     // Annotation @NotNull à remettre en place lorsque le support d'un payload
//     // json sans properties_version_id sera officiellement arrêté
//     @SerializedName("properties_version_id")
//     @JsonProperty("properties_version_id")
//     @Valid
//     Long propertiesVersionId;
// 
//     @NotNull
//     @SerializedName("key_value_properties")
//     @JsonProperty("key_value_properties")
//     @Valid
//     Set<ValuedPropertyIO> valuedProperties;
// 
//     @NotNull
//     @SerializedName("iterable_properties")
//     @JsonProperty("iterable_properties")
//     @Valid
//     Set<IterableValuedPropertyIO> iterableValuedProperties;
// 
//     public List<AbstractValuedProperty> toDomainInstances() {
//         List<ValuedProperty> valuedProperties = ValuedPropertyIO.toDomainInstances(this.valuedProperties);
//         List<IterableValuedProperty> iterableValuedProperties = IterableValuedPropertyIO.toDomainInstances(this.iterableValuedProperties);
//         List<AbstractValuedProperty> properties = new ArrayList<>();
//         properties.addAll(valuedProperties);
//         properties.addAll(iterableValuedProperties);
//         return properties;
//     }
// 
//     public PropertiesIO(Long propertiesVersionId, List<AbstractValuedPropertyView> abstractValuedPropertyViews) {
//         this.propertiesVersionId = propertiesVersionId;
//         List<ValuedPropertyView> valuedPropertyViews = AbstractValuedPropertyView.getAbstractValuedPropertyViewWithType(abstractValuedPropertyViews, ValuedPropertyView.class);
//         valuedProperties = ValuedPropertyIO.fromValuedPropertyViews(valuedPropertyViews);
//         List<IterableValuedPropertyView> iterableValuedPropertyViews = AbstractValuedPropertyView.getAbstractValuedPropertyViewWithType(abstractValuedPropertyViews, IterableValuedPropertyView.class);
//         iterableValuedProperties = IterableValuedPropertyIO.fromIterableValuedPropertyViews(iterableValuedPropertyViews);
//     }
// 
//     // On initialise le propertiesVersionId dans le cas ou il n'est pas fourni (le temps de repassé l'attribut en @NotNull)
//     public Long getPropertiesVersionId() {
//         return propertiesVersionId != null ? propertiesVersionId : DeployedModule.INIT_PROPERTIES_VERSION_ID;
//     }
// }


import org.apache.commons.lang3.StringUtils;
import org.hesperides.core.presentation.io.ModuleIO;
import org.hesperides.core.presentation.io.platforms.*;
import org.hesperides.core.presentation.io.platforms.properties.GlobalPropertyUsageOutput;
import org.hesperides.core.presentation.io.platforms.properties.PlatformDetailedPropertiesOutput;
import org.hesperides.core.presentation.io.platforms.properties.PropertiesIO;
import org.hesperides.core.presentation.io.platforms.properties.PropertySearchResultOutput;
import org.hesperides.core.presentation.io.platforms.properties.diff.PropertiesDiffOutput;
import org.hesperides.test.bdd.commons.TestContext;
import org.hesperides.test.bdd.configuration.CustomRestTemplate;
import org.hesperides.test.bdd.templatecontainers.TestVersionType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Set;
import static org.hesperides.test.bdd.commons.TestContext.getResponseType;
        String url = "/applications/platforms/perform_search?applicationName=" + applicationName;
        if (StringUtils.isNotBlank(platformName)) {
            url += "&platformName=" + platformName;
        }
        restTemplate.postForEntity(
                url,
                null,
                getResponseType(tryTo, SearchResultOutput[].class));
    }

    public InstancesModelOutput getInstancesModel(PlatformIO platform, String propertiesPath) {
        restTemplate.getForEntity(
                "/applications/{application_name}/platforms/{platform_name}/properties/instance_model?path={path}",
                InstancesModelOutput.class,
                platform.getApplicationName(),
                platform.getPlatformName(),
                propertiesPath);
        return testContext.getResponseBody();
    }

    public void cleanUnusedProperties(PlatformIO platformInput, String propertiesPath, String tryTo) {
        restTemplate.deleteForEntity(
                "/applications/{application_name}/platforms/{platform_name}/properties/clean_unused_properties?properties_path={path}",
                getResponseType(tryTo, Void.class),
                platformInput.getApplicationName(),
                platformInput.getPlatformName(),
                propertiesPath
        );
    }

// Path: core/presentation/src/main/java/org/hesperides/core/presentation/io/platforms/properties/PropertiesIO.java
// @Value
// @AllArgsConstructor
// public class PropertiesIO {
// 
//     // Annotation @NotNull à remettre en place lorsque le support d'un payload
//     // json sans properties_version_id sera officiellement arrêté
//     @SerializedName("properties_version_id")
//     @JsonProperty("properties_version_id")
//     @Valid
//     Long propertiesVersionId;
// 
//     @NotNull
//     @SerializedName("key_value_properties")
//     @JsonProperty("key_value_properties")
//     @Valid
//     Set<ValuedPropertyIO> valuedProperties;
// 
//     @NotNull
//     @SerializedName("iterable_properties")
//     @JsonProperty("iterable_properties")
//     @Valid
//     Set<IterableValuedPropertyIO> iterableValuedProperties;
// 
//     public List<AbstractValuedProperty> toDomainInstances() {
//         List<ValuedProperty> valuedProperties = ValuedPropertyIO.toDomainInstances(this.valuedProperties);
//         List<IterableValuedProperty> iterableValuedProperties = IterableValuedPropertyIO.toDomainInstances(this.iterableValuedProperties);
//         List<AbstractValuedProperty> properties = new ArrayList<>();
//         properties.addAll(valuedProperties);
//         properties.addAll(iterableValuedProperties);
//         return properties;
//     }
// 
//     public PropertiesIO(Long propertiesVersionId, List<AbstractValuedPropertyView> abstractValuedPropertyViews) {
//         this.propertiesVersionId = propertiesVersionId;
//         List<ValuedPropertyView> valuedPropertyViews = AbstractValuedPropertyView.getAbstractValuedPropertyViewWithType(abstractValuedPropertyViews, ValuedPropertyView.class);
//         valuedProperties = ValuedPropertyIO.fromValuedPropertyViews(valuedPropertyViews);
//         List<IterableValuedPropertyView> iterableValuedPropertyViews = AbstractValuedPropertyView.getAbstractValuedPropertyViewWithType(abstractValuedPropertyViews, IterableValuedPropertyView.class);
//         iterableValuedProperties = IterableValuedPropertyIO.fromIterableValuedPropertyViews(iterableValuedPropertyViews);
//     }
// 
//     // On initialise le propertiesVersionId dans le cas ou il n'est pas fourni (le temps de repassé l'attribut en @NotNull)
//     public Long getPropertiesVersionId() {
//         return propertiesVersionId != null ? propertiesVersionId : DeployedModule.INIT_PROPERTIES_VERSION_ID;
//     }
// }


// Path: tests/bdd/src/main/java/org/hesperides/test/bdd/platforms/PlatformClient.java
import org.apache.commons.lang3.StringUtils;
import org.hesperides.core.presentation.io.ModuleIO;
import org.hesperides.core.presentation.io.platforms.*;
import org.hesperides.core.presentation.io.platforms.properties.GlobalPropertyUsageOutput;
import org.hesperides.core.presentation.io.platforms.properties.PlatformDetailedPropertiesOutput;
import org.hesperides.core.presentation.io.platforms.properties.PropertiesIO;
import org.hesperides.core.presentation.io.platforms.properties.PropertySearchResultOutput;
import org.hesperides.core.presentation.io.platforms.properties.diff.PropertiesDiffOutput;
import org.hesperides.test.bdd.commons.TestContext;
import org.hesperides.test.bdd.configuration.CustomRestTemplate;
import org.hesperides.test.bdd.templatecontainers.TestVersionType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Set;
import static org.hesperides.test.bdd.commons.TestContext.getResponseType;

        String url = "/applications/platforms/perform_search?applicationName=" + applicationName;
        if (StringUtils.isNotBlank(platformName)) {
            url += "&platformName=" + platformName;
        }
        restTemplate.postForEntity(
                url,
                null,
                getResponseType(tryTo, SearchResultOutput[].class));
    }

    public InstancesModelOutput getInstancesModel(PlatformIO platform, String propertiesPath) {
        restTemplate.getForEntity(
                "/applications/{application_name}/platforms/{platform_name}/properties/instance_model?path={path}",
                InstancesModelOutput.class,
                platform.getApplicationName(),
                platform.getPlatformName(),
                propertiesPath);
        return testContext.getResponseBody();
    }

    public void cleanUnusedProperties(PlatformIO platformInput, String propertiesPath, String tryTo) {
        restTemplate.deleteForEntity(
                "/applications/{application_name}/platforms/{platform_name}/properties/clean_unused_properties?properties_path={path}",
                getResponseType(tryTo, Void.class),
                platformInput.getApplicationName(),
                platformInput.getPlatformName(),
                propertiesPath
        );
    }

    public void saveGlobalProperties(PlatformIO platform, PropertiesIO propertiesInput) {