use of org.alien4cloud.tosca.model.workflow.WorkflowStep 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