use of alien4cloud.rest.service.model.CreateServiceResourceRequest in project alien4cloud by alien4cloud.
the class ServiceStepDefinitions method createService.
@When("^I (successfully\\s)?create a service with name \"(.*?)\", version \"(.*?)\", type \"(.*?)\", archive version \"(.*?)\"$")
public void createService(String successfully, String serviceName, String serviceVersion, String type, String archiveVersion) throws Throwable {
CreateServiceResourceRequest request = new CreateServiceResourceRequest(nullable(serviceName), nullable(serviceVersion), nullable(type), nullable(archiveVersion));
Context.getInstance().registerRestResponse(getRestClientInstance().postJSon("/rest/v1/services/", JsonUtil.toString(request)));
CommonStepDefinitions.validateIfNeeded(StringUtils.isNotBlank(successfully));
try {
LAST_CREATED_ID = JsonUtil.read(Context.getInstance().getRestResponse(), String.class).getData();
Context.getInstance().registerService(LAST_CREATED_ID, serviceName);
} catch (Throwable t) {
}
}
Aggregations