@Test public void testEvaluateConnectionContextOnce() { tested.evaluate(ruleSet, connectionContext); tested.evaluate(ruleSet, connectionContext); verify(ruleSet, times(1)).getRules(); verify(connectionHandler, times(2)).evaluate(eq(connectionRule), eq(connectionContext)); verify(containmentHandler, never()).evaluate(any(CanContain.class), any(ContainmentContext.class)); }
@Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { return ruleManager.evaluate(ruleSet, context); }
CachedRuleManager implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { return ruleManager.evaluate(ruleSet, context); } }
CachedRuleManager implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { return ruleManager.evaluate(ruleSet, context); } @Inject  CachedRuleManager(final RuleManagerImpl ruleManager); }
CachedRuleManager implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { return ruleManager.evaluate(ruleSet, context); } @Inject  CachedRuleManager(final RuleManagerImpl ruleManager); @PostConstruct void init(); @Override RuleHandlerRegistry registry(); @Override RuleViolations evaluate(final RuleSet ruleSet,
                                   final RuleEvaluationContext context); @PreDestroy void destroy(); }
CachedRuleManager implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { return ruleManager.evaluate(ruleSet, context); } @Inject  CachedRuleManager(final RuleManagerImpl ruleManager); @PostConstruct void init(); @Override RuleHandlerRegistry registry(); @Override RuleViolations evaluate(final RuleSet ruleSet,
                                   final RuleEvaluationContext context); @PreDestroy void destroy();  }