use of org.kie.workbench.common.stunner.core.rule.violations.ContainmentRuleViolation in project kie-wb-common by kiegroup.
the class DockNodeCommandTest method testExecuteCheckFailed.
@Test
@SuppressWarnings("unchecked")
public void testExecuteCheckFailed() {
final RuleViolations FAILED_VIOLATIONS = new DefaultRuleViolations().addViolation(new ContainmentRuleViolation(graph.getUUID(), PARENT_UUID));
when(ruleManager.evaluate(any(RuleSet.class), any(RuleEvaluationContext.class))).thenReturn(FAILED_VIOLATIONS);
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.ERROR, result.getType());
assertTrue(parent.getOutEdges().isEmpty());
assertTrue(candidate.getInEdges().isEmpty());
}
use of org.kie.workbench.common.stunner.core.rule.violations.ContainmentRuleViolation in project kie-wb-common by kiegroup.
the class SetParentNodeCommandTest method testExecuteCheckFailed.
@Test
@SuppressWarnings("unchecked")
public void testExecuteCheckFailed() {
final RuleViolations FAILED_VIOLATIONS = new DefaultRuleViolations().addViolation(new ContainmentRuleViolation(graph.getUUID(), PARENT_UUID));
when(ruleManager.evaluate(any(RuleSet.class), any(RuleEvaluationContext.class))).thenReturn(FAILED_VIOLATIONS);
CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
assertEquals(CommandResult.Type.ERROR, result.getType());
assertTrue(parent.getOutEdges().isEmpty());
assertTrue(candidate.getInEdges().isEmpty());
}
Aggregations