use of org.broadleafcommerce.core.offer.service.processor.OrderOfferProcessorImpl in project BroadleafCommerce by BroadleafCommerce.
the class OfferServiceTest method setUp.
@Override
protected void setUp() throws Exception {
offerService = new OfferServiceImpl() {
@Override
protected List<OfferCode> refreshOfferCodesIfApplicable(Order order) {
return order.getAddedOfferCodes();
}
};
customerOfferDaoMock = EasyMock.createMock(CustomerOfferDao.class);
orderServiceMock = EasyMock.createMock(OrderService.class);
offerCodeDaoMock = EasyMock.createMock(OfferCodeDao.class);
offerDaoMock = EasyMock.createMock(OfferDao.class);
orderItemDaoMock = EasyMock.createMock(OrderItemDao.class);
offerService.setCustomerOfferDao(customerOfferDaoMock);
offerService.setOfferCodeDao(offerCodeDaoMock);
offerService.setOfferDao(offerDaoMock);
offerService.setOrderService(orderServiceMock);
orderItemServiceMock = EasyMock.createMock(OrderItemService.class);
fgItemDaoMock = EasyMock.createMock(FulfillmentGroupItemDao.class);
fgServiceMock = EasyMock.createMock(FulfillmentGroupService.class);
multishipOptionServiceMock = EasyMock.createMock(OrderMultishipOptionService.class);
offerTimeZoneProcessorMock = EasyMock.createMock(OfferTimeZoneProcessor.class);
OfferServiceUtilitiesImpl offerServiceUtilities = new OfferServiceUtilitiesImpl();
offerServiceUtilities.setOfferDao(offerDaoMock);
offerServiceUtilities.setPromotableItemFactory(new PromotableItemFactoryImpl());
OrderOfferProcessorImpl orderProcessor = new OrderOfferProcessorImpl();
orderProcessor.setOfferDao(offerDaoMock);
orderProcessor.setOrderItemDao(orderItemDaoMock);
orderProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
orderProcessor.setOfferTimeZoneProcessor(offerTimeZoneProcessorMock);
orderProcessor.setOfferServiceUtilities(offerServiceUtilities);
offerService.setOrderOfferProcessor(orderProcessor);
ItemOfferProcessorImpl itemProcessor = new ItemOfferProcessorImpl();
itemProcessor.setOfferDao(offerDaoMock);
itemProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
itemProcessor.setOfferServiceUtilities(offerServiceUtilities);
offerService.setItemOfferProcessor(itemProcessor);
FulfillmentGroupOfferProcessor fgProcessor = new FulfillmentGroupOfferProcessorImpl();
fgProcessor.setOfferDao(offerDaoMock);
fgProcessor.setPromotableItemFactory(new PromotableItemFactoryImpl());
offerService.setFulfillmentGroupOfferProcessor(fgProcessor);
offerService.setPromotableItemFactory(new PromotableItemFactoryImpl());
}
Aggregations