@Test public void testAcceptWhenIsNotExpectedClass() { when(rule.getId()).thenReturn("SomeOtherClass"); final boolean actual = check.accepts(rule, context); assertFalse(actual); }
@Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; } }
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }  }
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }  @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
                           final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
                                   final GraphConnectionContext context); }
NoInputNodesInImportedDecisionRule extends RuleExtensionHandler<NoInputNodesInImportedDecisionRule, GraphConnectionContext> { @Override public boolean accepts(final RuleExtension rule, final GraphConnectionContext context) { if (context.getTarget().isPresent()) { final Node<? extends View<?>, ? extends Edge> target = context.getTarget().get(); final View<?> content = target.getContent(); if (Objects.isNull(content)) { return false; } final Object definition = content.getDefinition(); return Objects.equals(definition.getClass().getName(), rule.getId()); } return false; }  @Override Class<NoInputNodesInImportedDecisionRule> getExtensionType(); @Override Class<GraphConnectionContext> getContextType(); @Override boolean accepts(final RuleExtension rule,
                           final GraphConnectionContext context); @Override RuleViolations evaluate(final RuleExtension rule,
                                   final GraphConnectionContext context);  }