use of alien4cloud.rest.csar.CsarInfoDTO in project alien4cloud by alien4cloud.
the class CrudCSARSStepDefinition method I_have_the_CSAR_version_to_contain_a_dependency_to_version.
@Then("^I have the CSAR \"([^\"]*)\" version \"([^\"]*)\" to contain a dependency to \"([^\"]*)\" version \"([^\"]*)\"$")
public void I_have_the_CSAR_version_to_contain_a_dependency_to_version(String csarName, String csarVersion, String dependencyName, String dependencyVersion) throws Throwable {
String response = Context.getRestClientInstance().get("/rest/v1/csars/" + csarName + ":" + csarVersion + "-SNAPSHOT");
CsarInfoDTO csar = JsonUtil.read(response, CsarInfoDTO.class).getData();
Assert.assertTrue(csar.getCsar().getDependencies().contains(new CSARDependency(dependencyName, dependencyVersion)));
}
use of alien4cloud.rest.csar.CsarInfoDTO in project alien4cloud by alien4cloud.
the class CrudCSARSStepDefinition method The_csar_version_does_not_depend_on_csar_version.
@Then("^The CSAR \"([^\"]*)\" version \"([^\"]*)\" does not have a dependency to \"([^\"]*)\" version \"([^\"]*)\"$")
public void The_csar_version_does_not_depend_on_csar_version(String csarName, String csarVersion, String dependencyName, String dependencyVersion) throws Throwable {
String response = Context.getRestClientInstance().get("/rest/v1/csars/" + csarName + ":" + csarVersion);
CsarInfoDTO csar = JsonUtil.read(response, CsarInfoDTO.class).getData();
Assert.assertFalse(csar.getCsar().getDependencies().contains(new CSARDependency(dependencyName, dependencyVersion)));
}
use of alien4cloud.rest.csar.CsarInfoDTO in project alien4cloud by alien4cloud.
the class CrudCSARSStepDefinition method I_have_CSAR_created_with_id.
@Then("^I should have a CSAR with id \"([^\"]*)\"$")
public void I_have_CSAR_created_with_id(String csarId) throws Throwable {
Context.getInstance().registerRestResponse(Context.getRestClientInstance().get("/rest/v1/csars/" + csarId));
commonStepDefinitions.I_should_receive_a_RestResponse_with_no_error();
CsarInfoDTO csarInfoDTO = JsonUtil.read(Context.getInstance().takeRestResponse(), CsarInfoDTO.class).getData();
Assert.assertNotNull(csarInfoDTO);
Assert.assertEquals(csarInfoDTO.getCsar().getId(), csarId);
}
Aggregations