@Test public void testEvaluateContainmentContextOnce() { tested.evaluate(ruleSet, containmentContext); tested.evaluate(ruleSet, containmentContext); verify(ruleSet, times(1)).getRules(); verify(containmentHandler, times(2)).evaluate(eq(containmentRule), eq(containmentContext)); verify(connectionHandler, never()).evaluate(any(CanConnect.class), any(ConnectionContext.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();  }