Search in sources :

Example 1 with PropertyValidationRequest

use of alien4cloud.rest.internal.model.PropertyValidationRequest in project alien4cloud by alien4cloud.

the class LocationsDefinitionsSteps method I_set_the_value_to_the_location_meta_property_of_the_location_of_the_orchestrator.

@When("^I set the value \"([^\"]*)\" to the location meta-property \"([^\"]*)\" of the location \"([^\"]*)\" of the orchestrator \"([^\"]*)\"$")
public void I_set_the_value_to_the_location_meta_property_of_the_location_of_the_orchestrator(String value, String metaPropertyName, String locationName, String orchestratorName) throws Throwable {
    MetaPropConfiguration propertyDefinition = Context.getInstance().getConfigurationTag(metaPropertyName);
    PropertyValidationRequest propertyCheckRequest = new PropertyValidationRequest(value, propertyDefinition.getId(), propertyDefinition, null);
    String orchestratorId = Context.getInstance().getOrchestratorId(orchestratorName);
    String locationId = getLocationIdFromName(orchestratorName, locationName);
    String restUrl = String.format("/rest/v1/orchestrators/%s/locations/%s/properties", orchestratorId, locationId);
    Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon(restUrl, JsonUtil.toString(propertyCheckRequest)));
}
Also used : MetaPropConfiguration(alien4cloud.model.common.MetaPropConfiguration) PropertyValidationRequest(alien4cloud.rest.internal.model.PropertyValidationRequest) When(cucumber.api.java.en.When)

Example 2 with PropertyValidationRequest

use of alien4cloud.rest.internal.model.PropertyValidationRequest in project alien4cloud by alien4cloud.

the class PropertiesDefinitionsSteps method I_fill_the_value_for_tag.

@When("^I fill the value \"([^\"]*)\" for \"([^\"]*)\" tag to check$")
public void I_fill_the_value_for_tag(String value, String configurationTagName) throws Throwable {
    MetaPropConfiguration tag = Context.getInstance().getConfigurationTag(configurationTagName);
    PropertyValidationRequest propertyCheckRequest = new PropertyValidationRequest(value, configurationTagName, tag, null);
    Context.getInstance().registerRestResponse(Context.getRestClientInstance().postJSon("/rest/v1/properties/check", JsonUtil.toString(propertyCheckRequest)));
}
Also used : MetaPropConfiguration(alien4cloud.model.common.MetaPropConfiguration) PropertyValidationRequest(alien4cloud.rest.internal.model.PropertyValidationRequest) When(cucumber.api.java.en.When)

Aggregations

MetaPropConfiguration (alien4cloud.model.common.MetaPropConfiguration)2 PropertyValidationRequest (alien4cloud.rest.internal.model.PropertyValidationRequest)2 When (cucumber.api.java.en.When)2