使用drools进行规则引擎开发,进行单元测试的时候报错:<ERROR> KnowledgeBuilderError happend errors:Rule Compilation error The method setIsSpam(Boolean) in the type SpamRuleStruct is not applicable for the arguments (boolean)
其中java测试源代码如下:@Test
public void test8() throws Exception {
RfqStruct rfqStruct = new RfqStruct();
RfqResult rfqResult = new RfqResult(); rfqStruct.setCategory1_id(4);
rfqStruct.setQuantity(1001);
rfqStruct.setCookieCountry("Cameroon");
rfqStruct.setCategory1_name("Textiles & Leather Products"); BuyerProfile buyerProfile = new BuyerProfile();
buyerProfile.setCountry("China");
buyerProfile.setCompanyName(null);
buyerProfile.setEmailVerifyState("Y"); rfqStruct.setBuyerProfile(buyerProfile); RfqFlags rfqFlags = new RfqFlags(); rfqResult.setCategoryEnum(CategoryEnum.Textiles_Leather_Products);
rfqResult.setRfqStruct(rfqStruct);
rfqResult.setRfqFlags(rfqFlags); spamAuditor.audit(rfqResult);
assertTrue(rfqResult.getRfqFlags().isSpam());
}
drools源代码如下:rule "Textiles & Leather Products 8"//2+3
activation-group "Textile"
when
auditFields:SpamRuleStruct(companyName == "" && cookieCountry != this.country)
then
auditFields.setIsSpam(true);
end
请各位帮忙看一下,小女子不胜感激了。