Search in sources :

Example 1 with ItemOfferProcessorImpl

use of org.broadleafcommerce.core.offer.service.processor.ItemOfferProcessorImpl 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());
}
Also used : Order(org.broadleafcommerce.core.order.domain.Order) FulfillmentGroupItemDao(org.broadleafcommerce.core.order.dao.FulfillmentGroupItemDao) ItemOfferProcessorImpl(org.broadleafcommerce.core.offer.service.processor.ItemOfferProcessorImpl) FulfillmentGroupOfferProcessorImpl(org.broadleafcommerce.core.offer.service.processor.FulfillmentGroupOfferProcessorImpl) OrderItemDao(org.broadleafcommerce.core.order.dao.OrderItemDao) CustomerOfferDao(org.broadleafcommerce.core.offer.dao.CustomerOfferDao) OrderMultishipOptionService(org.broadleafcommerce.core.order.service.OrderMultishipOptionService) FulfillmentGroupService(org.broadleafcommerce.core.order.service.FulfillmentGroupService) FulfillmentGroupOfferProcessor(org.broadleafcommerce.core.offer.service.processor.FulfillmentGroupOfferProcessor) PromotableItemFactoryImpl(org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl) OrderItemService(org.broadleafcommerce.core.order.service.OrderItemService) OfferTimeZoneProcessor(org.broadleafcommerce.core.offer.service.processor.OfferTimeZoneProcessor) List(java.util.List) ArrayList(java.util.ArrayList) OrderOfferProcessorImpl(org.broadleafcommerce.core.offer.service.processor.OrderOfferProcessorImpl) OrderService(org.broadleafcommerce.core.order.service.OrderService) OfferCodeDao(org.broadleafcommerce.core.offer.dao.OfferCodeDao) CustomerOfferDao(org.broadleafcommerce.core.offer.dao.CustomerOfferDao) OfferDao(org.broadleafcommerce.core.offer.dao.OfferDao)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 CustomerOfferDao (org.broadleafcommerce.core.offer.dao.CustomerOfferDao)1 OfferCodeDao (org.broadleafcommerce.core.offer.dao.OfferCodeDao)1 OfferDao (org.broadleafcommerce.core.offer.dao.OfferDao)1 PromotableItemFactoryImpl (org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl)1 FulfillmentGroupOfferProcessor (org.broadleafcommerce.core.offer.service.processor.FulfillmentGroupOfferProcessor)1 FulfillmentGroupOfferProcessorImpl (org.broadleafcommerce.core.offer.service.processor.FulfillmentGroupOfferProcessorImpl)1 ItemOfferProcessorImpl (org.broadleafcommerce.core.offer.service.processor.ItemOfferProcessorImpl)1 OfferTimeZoneProcessor (org.broadleafcommerce.core.offer.service.processor.OfferTimeZoneProcessor)1 OrderOfferProcessorImpl (org.broadleafcommerce.core.offer.service.processor.OrderOfferProcessorImpl)1 FulfillmentGroupItemDao (org.broadleafcommerce.core.order.dao.FulfillmentGroupItemDao)1 OrderItemDao (org.broadleafcommerce.core.order.dao.OrderItemDao)1 Order (org.broadleafcommerce.core.order.domain.Order)1 FulfillmentGroupService (org.broadleafcommerce.core.order.service.FulfillmentGroupService)1 OrderItemService (org.broadleafcommerce.core.order.service.OrderItemService)1 OrderMultishipOptionService (org.broadleafcommerce.core.order.service.OrderMultishipOptionService)1 OrderService (org.broadleafcommerce.core.order.service.OrderService)1