use of alien4cloud.rest.deployment.DeploymentDTO in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method I_should_not_get_a_deployment_if_I_ask_one_for_application.
@Then("^I should not get a deployment if I ask one for application \"([^\"]*)\" on orchestrator \"([^\"]*)\"$")
public void I_should_not_get_a_deployment_if_I_ask_one_for_application(String applicationName, String orchestrator) throws Throwable {
String orchestratorId = Context.getInstance().getOrchestratorId(orchestrator);
assertNotNull(ApplicationStepDefinitions.CURRENT_APPLICATIONS);
Application app = ApplicationStepDefinitions.CURRENT_APPLICATIONS.get(applicationName);
NameValuePair nvp = new BasicNameValuePair("sourceId", app.getId());
NameValuePair nvp1 = new BasicNameValuePair("orchestratorId", orchestratorId);
String responseString = Context.getRestClientInstance().getUrlEncoded("/rest/v1/deployments", Lists.newArrayList(nvp, nvp1));
RestResponse<?> response = JsonUtil.read(responseString);
assertNull(response.getError());
List<DeploymentDTO> deployments = JsonUtil.toList(JsonUtil.toString(response.getData()), DeploymentDTO.class, Application.class, Context.getJsonMapper());
Assert.assertTrue(CollectionUtils.isEmpty(deployments));
}
use of alien4cloud.rest.deployment.DeploymentDTO in project alien4cloud by alien4cloud.
the class ApplicationsDeploymentStepDefinitions method getApplicationNames.
private String[] getApplicationNames(Collection<DeploymentDTO> list) {
String[] names = null;
for (DeploymentDTO dto : list) {
names = ArrayUtils.add(names, dto.getSource().getName());
}
Arrays.sort(names);
return names;
}
Aggregations