use of org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl in project BroadleafCommerce by BroadleafCommerce.
the class FulfillmentGroupOfferProcessorTest method setUp.
@Override
protected void setUp() throws Exception {
offerService = new OfferServiceImpl();
CustomerOfferDao customerOfferDaoMock = EasyMock.createMock(CustomerOfferDao.class);
OfferCodeDao offerCodeDaoMock = EasyMock.createMock(OfferCodeDao.class);
orderServiceMock = EasyMock.createMock(OrderService.class);
orderItemDaoMock = EasyMock.createMock(OrderItemDao.class);
orderItemServiceMock = EasyMock.createMock(OrderItemService.class);
fgItemDaoMock = EasyMock.createMock(FulfillmentGroupItemDao.class);
offerDaoMock = EasyMock.createMock(OfferDao.class);
fgServiceMock = EasyMock.createMock(FulfillmentGroupService.class);
multishipOptionServiceMock = EasyMock.createMock(OrderMultishipOptionService.class);
offerServiceUtilitiesMock = EasyMock.createMock(OfferServiceUtilities.class);
offerTimeZoneProcessorMock = EasyMock.createMock(OfferTimeZoneProcessor.class);
fgProcessor = new TestableFulfillmentGroupOfferProcessor();
fgProcessor.setOfferDao(offerDaoMock);
fgProcessor.setOrderItemDao(orderItemDaoMock);
fgProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
fgProcessor.setOfferServiceUtilities(offerServiceUtilitiesMock);
OfferServiceUtilitiesImpl offerServiceUtilities = new OfferServiceUtilitiesImpl();
offerServiceUtilities.setOfferDao(offerDaoMock);
offerServiceUtilities.setPromotableItemFactory(new PromotableItemFactoryImpl());
OrderOfferProcessorImpl orderProcessor = new OrderOfferProcessorImpl();
orderProcessor.setOfferDao(offerDaoMock);
orderProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
orderProcessor.setOfferServiceUtilities(offerServiceUtilitiesMock);
orderProcessor.setOfferTimeZoneProcessor(offerTimeZoneProcessorMock);
orderProcessor.setOrderItemDao(orderItemDaoMock);
orderProcessor.setOfferServiceUtilities(offerServiceUtilities);
ItemOfferProcessorImpl itemProcessor = new ItemOfferProcessorImpl();
itemProcessor.setOfferDao(offerDaoMock);
itemProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
itemProcessor.setOrderItemDao(orderItemDaoMock);
itemProcessor.setOfferServiceUtilities(offerServiceUtilities);
offerService.setCustomerOfferDao(customerOfferDaoMock);
offerService.setOfferCodeDao(offerCodeDaoMock);
offerService.setOfferDao(offerDaoMock);
offerService.setOrderOfferProcessor(orderProcessor);
offerService.setItemOfferProcessor(itemProcessor);
offerService.setFulfillmentGroupOfferProcessor(fgProcessor);
offerService.setPromotableItemFactory(new PromotableItemFactoryImpl());
offerService.setOrderService(orderServiceMock);
}
use of org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl in project BroadleafCommerce by BroadleafCommerce.
the class OrderItemTest method setUp.
@Override
protected void setUp() throws Exception {
PromotableOrder promotableOrder = new PromotableOrderImpl(new OrderImpl(), new PromotableItemFactoryImpl(), false);
DiscreteOrderItemImpl discreteOrderItem1 = new DiscreteOrderItemImpl();
discreteOrderItem1.setName("test1");
discreteOrderItem1.setOrderItemType(OrderItemType.DISCRETE);
discreteOrderItem1.setQuantity(2);
discreteOrderItem1.setRetailPrice(new Money(19.99D));
OrderItemPriceDetail pdetail = new OrderItemPriceDetailImpl();
pdetail.setOrderItem(discreteOrderItem1);
pdetail.setQuantity(2);
PromotableOrderItem orderItem1 = new PromotableOrderItemImpl(discreteOrderItem1, null, new PromotableItemFactoryImpl(), false);
priceDetail1 = new PromotableOrderItemPriceDetailImpl(orderItem1, 2);
OfferDataItemProvider dataProvider = new OfferDataItemProvider();
offer = dataProvider.createItemBasedOfferWithItemCriteria("order.subTotal.getAmount()>20", OfferDiscountType.PERCENT_OFF, "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))", "([MVEL.eval(\"toUpperCase()\",\"test1\"), MVEL.eval(\"toUpperCase()\",\"test2\")] contains MVEL.eval(\"toUpperCase()\", discreteOrderItem.category.name))").get(0);
candidateOffer = new PromotableCandidateItemOfferImpl(promotableOrder, offer);
}
Aggregations