public class BandedPriceFulfillmentTest
extends junit.framework.TestCase
| Constructor and Description |
|---|
BandedPriceFulfillmentTest() |
| Modifier and Type | Method and Description |
|---|---|
protected org.broadleafcommerce.common.money.Money |
calculationResponse(org.broadleafcommerce.core.order.domain.FulfillmentOption option,
org.broadleafcommerce.core.order.domain.Order order) |
protected org.broadleafcommerce.core.order.domain.Order |
createCandidateOrder(BigDecimal retailTotal,
int orderItemsToCreate,
org.broadleafcommerce.core.order.domain.FulfillmentOption option) |
protected org.broadleafcommerce.core.order.domain.Order |
createCandidateOrder(BigDecimal total,
int orderItemsToCreate,
String[] flatRates,
int[] quantities,
org.broadleafcommerce.core.order.domain.FulfillmentOption option) |
protected org.broadleafcommerce.core.order.fulfillment.domain.BandedPriceFulfillmentOption |
createPriceBands(String[] minimumAmounts,
String[] resultAmounts,
org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType[] resultAmountTypes)
Creates price bands with the given minimum amounts, results and result types.
|
protected org.broadleafcommerce.core.order.fulfillment.domain.BandedWeightFulfillmentOption |
createWeightBands(String[] minimumAmounts,
String[] resultAmounts,
org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType[] resultAmountTypes) |
void |
testFlatRatesExclusive() |
void |
testFlatRatesWithBands() |
void |
testLowestPriceSelection()
If the retail price sum falls within 2 bands but with the same retail minimum, the lowest price should be selected
|
void |
testMinimumAmountsWithZero() |
void |
testPriceBandPercentage() |
void |
testPriceBandRate() |
void |
testPriceBandRatesWithPercentages() |
void |
testWeightBandsWithQuantities() |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toStringpublic void testMinimumAmountsWithZero()
throws Exception
Exceptionpublic void testPriceBandRatesWithPercentages()
throws Exception
Exceptionpublic void testLowestPriceSelection()
throws Exception
Exceptionpublic void testWeightBandsWithQuantities()
throws Exception
Exceptionprotected org.broadleafcommerce.core.order.domain.Order createCandidateOrder(BigDecimal retailTotal, int orderItemsToCreate, org.broadleafcommerce.core.order.domain.FulfillmentOption option)
protected org.broadleafcommerce.core.order.domain.Order createCandidateOrder(BigDecimal total, int orderItemsToCreate, String[] flatRates, int[] quantities, org.broadleafcommerce.core.order.domain.FulfillmentOption option)
total - - this number divided by the number of items to create is the value of either the weight or the price
(depending on which option is being passed in) for a single order item. Note that the final price of each item
will be: (total / orderItemsToCreate) * quantityorderItemsToCreate - - the number of order items to split the retail total acrossflatRates - - the flat rates to assign to the OrderItems that are created. To have an Order that is mixed between OrderItems and
DiscreteOrderItems (which are created for flat rates) ensure that the size of this array is less than orderItemsToCreatequantities - - the quantities to assign to each OrderItem. If specified, this should be equal to the number of
items to createoption - - the option to associate with the flat ratesprotected org.broadleafcommerce.common.money.Money calculationResponse(org.broadleafcommerce.core.order.domain.FulfillmentOption option,
org.broadleafcommerce.core.order.domain.Order order)
throws Exception
Exceptionprotected org.broadleafcommerce.core.order.fulfillment.domain.BandedPriceFulfillmentOption createPriceBands(String[] minimumAmounts, String[] resultAmounts, org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType[] resultAmountTypes)
minimumAmounts - resultAmounts - resultAmountTypes - Copyright © 2020. All rights reserved.