}
@Test
public void processDiscountWithEntryPoint() throws ObjectMappingException, ConfigurationException, RegistryException, MessageRouterException, ActionProcessingException
{
Order order = new Order();
order.setQuantity(20);
order.setUnitPrice( new BigDecimal("20.0") );
Message message = MessageFactory.getInstance().getMessage();
message.getBody().add("Order", order);
final ArrayList<String> defaultFacts = new ArrayList<String>();
defaultFacts.add("body.Counter");
final ArrayList<String> orderEntryPoints = new ArrayList<String>();
orderEntryPoints.add("body.Order");
Map<String, List<String>> entryPointFacts = new HashMap<String, List<String>>();
entryPointFacts.put("OrderEntryPoint", orderEntryPoints);
CBRConfigTreeBuilder builder = new CBRConfigTreeBuilder(true).ruleFile("PricingRulesStatefulEntryPoint.drl");
builder.messagePaths(defaultFacts).entryPoints(entryPointFacts);
ConfigTree config = builder.stateful(true).build();
BusinessRulesProcessor processor = new BusinessRulesProcessor(config);
processor.process( message );
assertEquals( 20.0, order.getDiscount(), 0 );
assertEquals( "20%" ,message.getBody().get("DiscountObject"));
}