@Test public void ruleRunnerShouldReturnNullRuleClassIsInvalid() { Class clazz = Class.class; Assert.assertNull(_ruleBook.getRuleInstance(clazz)); }
@Override protected Object getRuleInstance(Class<?> rule) { if (_applicationContext == null) { throw new IllegalStateException("Cannot instantiate RuleBookRunner because " + "Spring application context is not available."); } try { return _applicationContext.getBean(rule); } catch (BeansException e) { return super.getRuleInstance(rule); } }
SpringAwareRuleBookRunner extends RuleBookRunner implements ApplicationContextAware { @Override protected Object getRuleInstance(Class<?> rule) { if (_applicationContext == null) { throw new IllegalStateException("Cannot instantiate RuleBookRunner because " + "Spring application context is not available."); } try { return _applicationContext.getBean(rule); } catch (BeansException e) { return super.getRuleInstance(rule); } } }
SpringAwareRuleBookRunner extends RuleBookRunner implements ApplicationContextAware { @Override protected Object getRuleInstance(Class<?> rule) { if (_applicationContext == null) { throw new IllegalStateException("Cannot instantiate RuleBookRunner because " + "Spring application context is not available."); } try { return _applicationContext.getBean(rule); } catch (BeansException e) { return super.getRuleInstance(rule); } } SpringAwareRuleBookRunner(String rulePackage);  SpringAwareRuleBookRunner(Class<? extends RuleBook> ruleBookClass, String rulePackage);  SpringAwareRuleBookRunner(String rulePackage, Predicate<String> subPkgMatch);  SpringAwareRuleBookRunner(
      Class<? extends RuleBook> ruleBookClass, String rulePackage, Predicate<String> subPkgMatch); }
SpringAwareRuleBookRunner extends RuleBookRunner implements ApplicationContextAware { @Override protected Object getRuleInstance(Class<?> rule) { if (_applicationContext == null) { throw new IllegalStateException("Cannot instantiate RuleBookRunner because " + "Spring application context is not available."); } try { return _applicationContext.getBean(rule); } catch (BeansException e) { return super.getRuleInstance(rule); } } SpringAwareRuleBookRunner(String rulePackage);  SpringAwareRuleBookRunner(Class<? extends RuleBook> ruleBookClass, String rulePackage);  SpringAwareRuleBookRunner(String rulePackage, Predicate<String> subPkgMatch);  SpringAwareRuleBookRunner(
      Class<? extends RuleBook> ruleBookClass, String rulePackage, Predicate<String> subPkgMatch); @Override void setApplicationContext(ApplicationContext applicationContext); }
SpringAwareRuleBookRunner extends RuleBookRunner implements ApplicationContextAware { @Override protected Object getRuleInstance(Class<?> rule) { if (_applicationContext == null) { throw new IllegalStateException("Cannot instantiate RuleBookRunner because " + "Spring application context is not available."); } try { return _applicationContext.getBean(rule); } catch (BeansException e) { return super.getRuleInstance(rule); } } SpringAwareRuleBookRunner(String rulePackage);  SpringAwareRuleBookRunner(Class<? extends RuleBook> ruleBookClass, String rulePackage);  SpringAwareRuleBookRunner(String rulePackage, Predicate<String> subPkgMatch);  SpringAwareRuleBookRunner(
      Class<? extends RuleBook> ruleBookClass, String rulePackage, Predicate<String> subPkgMatch); @Override void setApplicationContext(ApplicationContext applicationContext);  }