@Test public void testSkipInventoryLeadTimeFfNoLead() throws Exception { final Warehouse warehouse = this.context.mock(Warehouse.class, "warehouse"); final LocalDate calendar = DateUtils.ldParseSDT("2017-02-07"); context.checking(new Expectations() {{ allowing(warehouse).getDefaultStandardStockLeadTime(); will(returnValue(0)); allowing(warehouse).getDefaultBackorderStockLeadTime(); will(returnValue(0)); }}); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.STANDARD_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.MIX_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.DATE_WAIT_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.INVENTORY_WAIT_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.NOSTOCK_DELIVERY_GROUP, warehouse, null, null, calendar) )); assertEquals("2017-02-07", DateUtils.formatSD( new DeliveryTimeEstimationVisitorDefaultImpl(null, null).skipInventoryLeadTime(CustomerOrderDelivery.OFFLINE_DELIVERY_GROUP, warehouse, null, null, calendar) )); this.context.assertIsSatisfied(); }
protected LocalDate skipInventoryLeadTime(final String deliveryGroup, final Warehouse warehouse, final Object itemsContainer, final Collection<CartItem> items, final LocalDate minDeliveryTime) { LocalDate min = minDeliveryTime; if (CustomerOrderDelivery.STANDARD_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultStandardStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultStandardStockLeadTime()); } } else if (!CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultBackorderStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultBackorderStockLeadTime()); } } return min; }
DeliveryTimeEstimationVisitorDefaultImpl implements DeliveryTimeEstimationVisitor, Configuration { protected LocalDate skipInventoryLeadTime(final String deliveryGroup, final Warehouse warehouse, final Object itemsContainer, final Collection<CartItem> items, final LocalDate minDeliveryTime) { LocalDate min = minDeliveryTime; if (CustomerOrderDelivery.STANDARD_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultStandardStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultStandardStockLeadTime()); } } else if (!CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultBackorderStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultBackorderStockLeadTime()); } } return min; } }
DeliveryTimeEstimationVisitorDefaultImpl implements DeliveryTimeEstimationVisitor, Configuration { protected LocalDate skipInventoryLeadTime(final String deliveryGroup, final Warehouse warehouse, final Object itemsContainer, final Collection<CartItem> items, final LocalDate minDeliveryTime) { LocalDate min = minDeliveryTime; if (CustomerOrderDelivery.STANDARD_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultStandardStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultStandardStockLeadTime()); } } else if (!CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultBackorderStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultBackorderStockLeadTime()); } } return min; } DeliveryTimeEstimationVisitorDefaultImpl(final WarehouseService warehouseService,
                                                    final CarrierSlaService carrierSlaService); }
DeliveryTimeEstimationVisitorDefaultImpl implements DeliveryTimeEstimationVisitor, Configuration { protected LocalDate skipInventoryLeadTime(final String deliveryGroup, final Warehouse warehouse, final Object itemsContainer, final Collection<CartItem> items, final LocalDate minDeliveryTime) { LocalDate min = minDeliveryTime; if (CustomerOrderDelivery.STANDARD_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultStandardStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultStandardStockLeadTime()); } } else if (!CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultBackorderStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultBackorderStockLeadTime()); } } return min; } DeliveryTimeEstimationVisitorDefaultImpl(final WarehouseService warehouseService,
                                                    final CarrierSlaService carrierSlaService); @Override void visit(final CustomerOrder order); @Override void visit(final CustomerOrderDelivery delivery); @Override void visit(final MutableShoppingCart shoppingCart); @Override ConfigurationContext getCfgContext(); void setCfgContext(final ConfigurationContext cfgContext); }
DeliveryTimeEstimationVisitorDefaultImpl implements DeliveryTimeEstimationVisitor, Configuration { protected LocalDate skipInventoryLeadTime(final String deliveryGroup, final Warehouse warehouse, final Object itemsContainer, final Collection<CartItem> items, final LocalDate minDeliveryTime) { LocalDate min = minDeliveryTime; if (CustomerOrderDelivery.STANDARD_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultStandardStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultStandardStockLeadTime()); } } else if (!CustomerOrderDelivery.ELECTRONIC_DELIVERY_GROUP.equals(deliveryGroup)) { final Warehouse ff = warehouse; if (ff != null && ff.getDefaultBackorderStockLeadTime() > 0) { min = min.plusDays(ff.getDefaultBackorderStockLeadTime()); } } return min; } DeliveryTimeEstimationVisitorDefaultImpl(final WarehouseService warehouseService,
                                                    final CarrierSlaService carrierSlaService); @Override void visit(final CustomerOrder order); @Override void visit(final CustomerOrderDelivery delivery); @Override void visit(final MutableShoppingCart shoppingCart); @Override ConfigurationContext getCfgContext(); void setCfgContext(final ConfigurationContext cfgContext);  }