@Test public void givenAttributesShouldMapToFacts() throws InvalidClassException { SampleRuleWithResult sampleRuleWithResult = new SampleRuleWithResult(); RuleAdapter ruleAdapter = new RuleAdapter(sampleRuleWithResult); ruleAdapter.given(_factMap); Assert.assertEquals("FirstFact", sampleRuleWithResult.getFact1()); Assert.assertEquals("SecondFact", sampleRuleWithResult.getFact2()); Assert.assertEquals(1, sampleRuleWithResult.getValue1()); }
@Override @SuppressWarnings("unchecked") public Decision given(Fact... facts) { _rule.given(facts); mapGivenFactsToProperties(); return this; }
RuleAdapter implements Decision { @Override @SuppressWarnings("unchecked") public Decision given(Fact... facts) { _rule.given(facts); mapGivenFactsToProperties(); return this; } }
RuleAdapter implements Decision { @Override @SuppressWarnings("unchecked") public Decision given(Fact... facts) { _rule.given(facts); mapGivenFactsToProperties(); return this; } @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo, Rule rule); @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo); }
RuleAdapter implements Decision { @Override @SuppressWarnings("unchecked") public Decision given(Fact... facts) { _rule.given(facts); mapGivenFactsToProperties(); return this; } @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo, Rule rule); @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo); @Override @SuppressWarnings("unchecked") Decision given(Fact... facts); @Override @SuppressWarnings("unchecked") Decision given(List list); @Override @SuppressWarnings("unchecked") Decision given(FactMap facts); @Override @SuppressWarnings("unchecked") Decision given(String name, Object value); @Override Decision givenUnTyped(FactMap facts); @Override Predicate getWhen(); @Override List<Object> getThen(); @Override void run(Object... otherArgs); @Override Decision when(Predicate test); @Override Decision then(Consumer action); @Override Decision then(BiConsumer action); @Override Decision using(String... factName); @Override Decision stop(); @Override Object getResult(); @Override void setResult(Result result); @Override FactMap getFactMap(); @Override void setNextRule(Rule rule); }
RuleAdapter implements Decision { @Override @SuppressWarnings("unchecked") public Decision given(Fact... facts) { _rule.given(facts); mapGivenFactsToProperties(); return this; } @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo, Rule rule); @SuppressWarnings("unchecked")  RuleAdapter(Object rulePojo); @Override @SuppressWarnings("unchecked") Decision given(Fact... facts); @Override @SuppressWarnings("unchecked") Decision given(List list); @Override @SuppressWarnings("unchecked") Decision given(FactMap facts); @Override @SuppressWarnings("unchecked") Decision given(String name, Object value); @Override Decision givenUnTyped(FactMap facts); @Override Predicate getWhen(); @Override List<Object> getThen(); @Override void run(Object... otherArgs); @Override Decision when(Predicate test); @Override Decision then(Consumer action); @Override Decision then(BiConsumer action); @Override Decision using(String... factName); @Override Decision stop(); @Override Object getResult(); @Override void setResult(Result result); @Override FactMap getFactMap(); @Override void setNextRule(Rule rule);  }