use of alien4cloud.topology.TopologyDTO in project alien4cloud by alien4cloud.
the class TopologyRecoveryStepDefinitions method the_node_in_the_topology_dto_should_have_relationshiptemplates.
@Then("^the node \"([^\"]*)\" in the topology dto should have (\\d+) relationshipTemplates$")
public void the_node_in_the_topology_dto_should_have_relationshiptemplates(String nodeName, int count) throws Throwable {
TopologyDTO dto = JsonUtil.read(Context.getInstance().getRestResponse(), TopologyDTO.class, Context.getJsonMapper()).getData();
NodeTemplate template = dto.getTopology().getNodeTemplates().get(nodeName);
Assert.assertNotNull(template);
Assert.assertEquals(count, template.getRelationships().size());
}
use of alien4cloud.topology.TopologyDTO in project alien4cloud by alien4cloud.
the class TopologyRecoveryStepDefinitions method I_node_in_the_topology_dto_should_not_have_the_requirement.
@Then("^the node \"([^\"]*)\" in the topology dto should not have the requirement \"([^\"]*)\"$")
public void I_node_in_the_topology_dto_should_not_have_the_requirement(String nodeName, String requirementName) throws IOException {
TopologyDTO dto = JsonUtil.read(Context.getInstance().getRestResponse(), TopologyDTO.class, Context.getJsonMapper()).getData();
NodeTemplate template = dto.getTopology().getNodeTemplates().get(nodeName);
Assert.assertNotNull(template);
assertFalse(template.getRequirements().containsKey(requirementName));
}
use of alien4cloud.topology.TopologyDTO in project alien4cloud by alien4cloud.
the class TopologyRecoveryStepDefinitions method there_should_not_be_the_relationship_in_node_template_in_the_topology_dto.
@Then("^there should not be the relationship \"([^\"]*)\" in \"([^\"]*)\" node template in the topology dto$")
public void there_should_not_be_the_relationship_in_node_template_in_the_topology_dto(String relName, String nodeName) throws IOException {
TopologyDTO dto = JsonUtil.read(Context.getInstance().getRestResponse(), TopologyDTO.class, Context.getJsonMapper()).getData();
NodeTemplate template = dto.getTopology().getNodeTemplates().get(nodeName);
Assert.assertNotNull(template);
assertFalse(template.getRelationships().containsKey(relName));
}
use of alien4cloud.topology.TopologyDTO in project alien4cloud by alien4cloud.
the class WorkflowStepDefinitions method the_workflow_step_is_followed_by.
@When("^The workflow step \"(.*?)\" is followed by: (.*)$")
public void the_workflow_step_is_followed_by(String stepId, List<String> followers) throws Throwable {
String topologyResponseText = Context.getInstance().getRestResponse();
RestResponse<TopologyDTO> topologyResponse = JsonUtil.read(topologyResponseText, TopologyDTO.class, Context.getJsonMapper());
String workflowName = Context.getInstance().getCurrentWorkflowName();
Workflow workflow = topologyResponse.getData().getTopology().getWorkflows().get(workflowName);
WorkflowStep step = workflow.getSteps().get(stepId);
Set<String> actualFollowers = step.getOnSuccess();
assertNotNull(actualFollowers);
assertEquals(followers.size(), actualFollowers.size());
for (String expectedFollower : followers) {
// we just remove the surrounding quotes
String follower = expectedFollower.substring(1, expectedFollower.length() - 1);
assertTrue(actualFollowers.contains(follower));
}
}
Aggregations