Class BandedPriceFulfillmentTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.broadleafcommerce.core.pricing.service.fulfillment.BandedPriceFulfillmentTest
- All Implemented Interfaces:
junit.framework.Test
public class BandedPriceFulfillmentTest
extends junit.framework.TestCase
- Author:
- Phillip Verheyden
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.broadleafcommerce.common.money.MoneycalculationResponse(org.broadleafcommerce.core.order.domain.FulfillmentOption option, org.broadleafcommerce.core.order.domain.Order order) protected org.broadleafcommerce.core.order.domain.OrdercreateCandidateOrder(BigDecimal total, int orderItemsToCreate, String[] flatRates, int[] quantities, org.broadleafcommerce.core.order.domain.FulfillmentOption option) protected org.broadleafcommerce.core.order.domain.OrdercreateCandidateOrder(BigDecimal retailTotal, int orderItemsToCreate, org.broadleafcommerce.core.order.domain.FulfillmentOption option) protected org.broadleafcommerce.core.order.fulfillment.domain.BandedPriceFulfillmentOptioncreatePriceBands(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.BandedWeightFulfillmentOptioncreateWeightBands(String[] minimumAmounts, String[] resultAmounts, org.broadleafcommerce.core.order.service.type.FulfillmentBandResultAmountType[] resultAmountTypes) voidvoidvoidIf the retail price sum falls within 2 bands but with the same retail minimum, the lowest price should be selectedvoidvoidvoidvoidvoidMethods inherited from class junit.framework.TestCase
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, toString
-
Constructor Details
-
BandedPriceFulfillmentTest
public BandedPriceFulfillmentTest()
-
-
Method Details
-
testPriceBandRate
- Throws:
Exception
-
testMinimumAmountsWithZero
- Throws:
Exception
-
testPriceBandPercentage
- Throws:
Exception
-
testPriceBandRatesWithPercentages
- Throws:
Exception
-
testLowestPriceSelection
If the retail price sum falls within 2 bands but with the same retail minimum, the lowest price should be selected- Throws:
Exception
-
testFlatRatesExclusive
- Throws:
Exception
-
testFlatRatesWithBands
- Throws:
Exception
-
testWeightBandsWithQuantities
- Throws:
Exception
-
createCandidateOrder
protected org.broadleafcommerce.core.order.domain.Order createCandidateOrder(BigDecimal retailTotal, int orderItemsToCreate, org.broadleafcommerce.core.order.domain.FulfillmentOption option) -
createCandidateOrder
protected org.broadleafcommerce.core.order.domain.Order createCandidateOrder(BigDecimal total, int orderItemsToCreate, String[] flatRates, int[] quantities, org.broadleafcommerce.core.order.domain.FulfillmentOption option) - Parameters:
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 rates- Returns:
-
calculationResponse
protected org.broadleafcommerce.common.money.Money calculationResponse(org.broadleafcommerce.core.order.domain.FulfillmentOption option, org.broadleafcommerce.core.order.domain.Order order) throws Exception - Throws:
Exception
-
createPriceBands
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. All of the lists should be the same size- Parameters:
minimumAmounts-resultAmounts-resultAmountTypes-- Returns:
-
createWeightBands
-