Search in sources :

Example 1 with InputArtifactTask

use of alien4cloud.topology.task.InputArtifactTask in project alien4cloud by alien4cloud.

the class DeploymentSetupValidationStepDefinitions method thereShouldBeNoMissingArtifactsTasks.

@Then("^there should be no missing artifacts tasks$")
public void thereShouldBeNoMissingArtifactsTasks() throws Throwable {
    TopologyValidationResult topologyValidationResult = JsonUtil.read(Context.getInstance().getRestResponse(), DeploymentTopologyDTO.class, Context.getJsonMapper()).getData().getValidation();
    boolean missingFound = topologyValidationResult.getTaskList().stream().anyMatch(task -> task instanceof InputArtifactTask);
    Assert.assertFalse(" Expected NO missing artifacts tasks for the deployment topology", missingFound);
}
Also used : TopologyValidationResult(alien4cloud.topology.TopologyValidationResult) InputArtifactTask(alien4cloud.topology.task.InputArtifactTask) Then(cucumber.api.java.en.Then)

Example 2 with InputArtifactTask

use of alien4cloud.topology.task.InputArtifactTask in project alien4cloud by alien4cloud.

the class DeploymentSetupValidationStepDefinitions method theMissingInputsArtifactsShouldBe.

@And("^the missing inputs artifacts should be$")
public void theMissingInputsArtifactsShouldBe(DataTable expectedInputArtifactsTable) throws Throwable {
    TopologyValidationResult topologyValidationResult = JsonUtil.read(Context.getInstance().getRestResponse(), DeploymentTopologyDTO.class, Context.getJsonMapper()).getData().getValidation();
    for (List<String> expectedRow : expectedInputArtifactsTable.raw()) {
        boolean missingFound = topologyValidationResult.getTaskList().stream().anyMatch(task -> task instanceof InputArtifactTask && ((InputArtifactTask) task).getInputArtifactName().equals(expectedRow.get(0)));
        Assert.assertTrue(expectedRow.get(0) + " does not appear in the task list for the deployment topology", missingFound);
    }
}
Also used : TopologyValidationResult(alien4cloud.topology.TopologyValidationResult) InputArtifactTask(alien4cloud.topology.task.InputArtifactTask) And(cucumber.api.java.en.And)

Aggregations

TopologyValidationResult (alien4cloud.topology.TopologyValidationResult)2 InputArtifactTask (alien4cloud.topology.task.InputArtifactTask)2 And (cucumber.api.java.en.And)1 Then (cucumber.api.java.en.Then)1