@DataProvider(name = "basicFulfillmentGroupLegacy") public static Object[][] provideBasicSalesFulfillmentGroupLegacy() { FulfillmentGroupImpl sos = new FulfillmentGroupImpl(); sos.setReferenceNumber("123456789"); sos.setMethod("standard"); sos.setService(ShippingServiceType.BANDED_SHIPPING.getType()); return new Object[][] { { sos } }; } }
@Override public Money getShippingPrice() { return getFulfillmentPrice(); }
public void testNullFulfillmentOptionInEstimation() throws Exception { Set<FulfillmentOption> options = new HashSet<FulfillmentOption>(); FixedPriceFulfillmentOption option1 = new FixedPriceFulfillmentOptionImpl(); option1.setPrice(new Money(BigDecimal.ONE)); FixedPriceFulfillmentOption option2= new FixedPriceFulfillmentOptionImpl(); option2.setPrice(new Money(BigDecimal.TEN)); options.add(option1); options.add(option2); FixedPriceFulfillmentPricingProvider provider = new FixedPriceFulfillmentPricingProvider(); FulfillmentGroup fg = new FulfillmentGroupImpl(); FulfillmentEstimationResponse response = provider.estimateCostForFulfillmentGroup(fg, options); for (Entry<? extends FulfillmentOption, Money> entry : response.getFulfillmentOptionPrices().entrySet()) { assertEquals(((FixedPriceFulfillmentOption) entry.getKey()).getPrice(), entry.getValue()); } }
@DataProvider(name = "basicFulfillmentGroup") public static Object[][] provideBasicSalesFulfillmentGroup() { FulfillmentGroupImpl sos = new FulfillmentGroupImpl(); sos.setReferenceNumber("123456789"); FixedPriceFulfillmentOption option = new FixedPriceFulfillmentOptionImpl(); option.setPrice(new Money(0)); sos.setFulfillmentOption(option); return new Object[][] { { sos } }; }
OrderImpl order = new OrderImpl(); order.setSubTotal(new Money(110D)); FulfillmentGroupImpl group = new FulfillmentGroupImpl(); group.setPrimary(true);
cloned.setMerchandiseTotal(merchandiseTotal == null ? null : new Money(merchandiseTotal)); cloned.setRetailFulfillmentPrice(fulfillmentPrice == null ? null : new Money(fulfillmentPrice)); cloneTaxDetails(context, cloned); cloned.setTotalItemTax(totalItemTax == null ? null : new Money(totalItemTax)); cloned.setTotalFulfillmentGroupTax(totalFulfillmentGroupTax == null ? null : new Money(totalFulfillmentGroupTax)); cloned.setOrder(order); cloned.setPrimary(primary); cloned.setType(getType()); for (FulfillmentGroupItem fgi: fulfillmentGroupItems) { FulfillmentGroupItem fulfillmentGroupItem = fgi.createOrRetrieveCopyInstance(context).getClone();
@Override public void setShippingPrice(Money shippingPrice) { setFulfillmentPrice(shippingPrice); }
@Override public Money getRetailShippingPrice() { return getRetailFulfillmentPrice(); }
@Override public Money getSaleShippingPrice() { return getSaleFulfillmentPrice(); }
protected void cloneTaxDetails(MultiTenantCopyContext context, FulfillmentGroup cloned) throws CloneNotSupportedException { for (TaxDetail taxDetail : getTaxes()) { TaxDetail clonedTaxDetail = taxDetail.createOrRetrieveCopyInstance(context).getClone(); cloned.getTaxes().add(clonedTaxDetail); } }
private FulfillmentGroup buildFulfillmentGroup(Order order, Address address) { FulfillmentGroup group = new FulfillmentGroupImpl(); group.setIsShippingPriceTaxable(true); group.setOrder(order); group.setAddress(address); List<FulfillmentGroup> groups = new ArrayList<>(); groups.add(group); order.setFulfillmentGroups(groups); Money total = new Money(5D); group.setShippingPrice(total); FixedPriceFulfillmentOption option = new FixedPriceFulfillmentOptionImpl(); option.setPrice(new Money(0)); option.setFulfillmentType(FulfillmentType.PHYSICAL_SHIP); group.setFulfillmentOption(option); return group; }
FulfillmentGroup group = new FulfillmentGroupImpl(); group.setOrder(result); group.setFulfillmentGroupItems(fulfillmentItems);
@Override public Money getFulfillmentPrice() { return fulfillmentPrice == null ? null : BroadleafCurrencyUtils.getMoney(fulfillmentPrice, getOrder().getCurrency()); }
private List<FulfillmentGroup> createFulfillmentGroups(FulfillmentOption option, Double shippingPrice, Order order) { List<FulfillmentGroup> groups = new ArrayList<FulfillmentGroup>(); FulfillmentGroup group = new FulfillmentGroupImpl(); group.setFulfillmentOption(option); groups.add(group);
@Override public Money getMerchandiseTotal() { return merchandiseTotal == null ? null : BroadleafCurrencyUtils.getMoney(merchandiseTotal, getOrder().getCurrency()); }
FulfillmentGroup group1 = new FulfillmentGroupImpl(); FulfillmentGroup group2 = new FulfillmentGroupImpl();
@Override public Money getSaleFulfillmentPrice() { return saleFulfillmentPrice == null ? null : BroadleafCurrencyUtils.getMoney(saleFulfillmentPrice, getOrder().getCurrency()); }
FulfillmentGroup fg1 = new FulfillmentGroupImpl(); fg1.setId(1L); Address address1 = new AddressImpl(); FulfillmentGroup fg2 = new FulfillmentGroupImpl(); fg2.setId(2L); Address address2 = new AddressImpl();
@Override public Money getRetailFulfillmentPrice() { return retailFulfillmentPrice == null ? null : BroadleafCurrencyUtils.getMoney(retailFulfillmentPrice, getOrder().getCurrency()); }