use of org.kie.workbench.common.stunner.core.rule.RuleViolations in project kie-wb-common by kiegroup.
the class SingleConnectorPerTypeGraphRuleTest method checkMissingConnectionTargetNodeDoesNotTriggerCheck.
@Test
@SuppressWarnings("unchecked")
public void checkMissingConnectionTargetNodeDoesNotTriggerCheck() {
final Node source = mock(Node.class);
when(context.getSource()).thenReturn(Optional.of(source));
when(context.getTarget()).thenReturn(Optional.empty());
when(context.getConnector()).thenReturn(connector);
final RuleViolations result = check.evaluate(rule, context);
assertNotNull(result);
assertFalse(result.violations().iterator().hasNext());
verify(check, never()).isConnectionAlreadyFormed(any(Node.class), any(Node.class), any(Edge.class));
}
Aggregations