use of alien4cloud.rest.tags.TagConfigurationSaveResponse in project alien4cloud by alien4cloud.
the class TagConfigurationStepDefinitions method I_load_several_configuration_tags.
@Given("^I load several configuration tags$")
public void I_load_several_configuration_tags() throws Throwable {
String tagConfigurationsJson = FileUtil.readTextFile(Paths.get(CONFIGURATION_TAGS));
List<MetaPropConfiguration> tagsArray = JsonUtil.readObject(tagConfigurationsJson);
// registering all configuration tags
for (Object tag : tagsArray) {
// register in ES
MetaPropConfiguration tagObject = JsonUtil.readObject(JsonUtil.toString(tag), MetaPropConfiguration.class);
String tagConfigurationJson = JsonUtil.toString(tagObject);
String response = Context.getRestClientInstance().postJSon("/rest/v1/metaproperties", tagConfigurationJson);
TagConfigurationSaveResponse tagReceived = JsonUtil.read(response, TagConfigurationSaveResponse.class).getData();
// register in context
tagObject.setId(tagReceived.getId());
Context.getInstance().registerConfigurationTag(tagObject.getName(), tagObject);
}
Assert.assertNotNull(Context.getInstance().getConfigurationTags());
}
Aggregations