Closed mikelear closed 4 years ago
I've create a pull request #168
That I think solves this issue , the SimpleRuleAdds class has to extend RuleBookAuditor and you have to have a constructor that create the RuleRunner.
I've added a new test in RuleBookAuditorTest that shows this working (with some changes to pass the Audit Map).
Cool, I'll check it out. Thanks.
I pulled over your code, merged it and gave your attribution in the POM. Thanks!
Hi @Clayton7510 before I keep digging further could you clarify , that I'm not missing something or doing something wrong.
If you look at the test
ruleBookAuditorCanAuditRules
it checks that the Rules are correctly Audited. But I'm trying to Audit Rules that are defined in a Class with defineRule overridden.
So if I create a similar test but instead write this
RuleBook rulebook = RuleBookBuilder.create(SimpleRuleAdds.class).asAuditor()
.build();
where SimpleRuleAdds is
public class SimpleRuleAdds extends CoRRuleBook {
then the _auditor is never set. This is because the addRule call isn't using the RuleBookAuditor , but I'm not sure how it should be. If I try to extend RuleBookAuditor instead of CoRRuleBook that doesn't work either.
I can dig some more and am happy to do so , but just wanted to check that there isn't a correct way to do this now (perhaps extending RuleBookAuditor), before I carry on debugging the code.