@UnitTest public class NoRestrictionsStrategyTest extends java.lang.Object
| Constructor and Description |
|---|
NoRestrictionsStrategyTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertEqualQuantity(SourcingContext context,
long qtyExpected,
ProductModel product,
java.lang.String posName) |
protected void |
assertEqualsQuantityAllocation(java.util.Set<SourcingResult> results,
java.lang.String pos,
int qtyExpected) |
void |
setup() |
void |
shouldFail_nullContext() |
void |
testNothingSourced()
Given an order with 2 entries:
entry 1 : {quantity: 10, product: PROPANE_BARBECUE} entry 2 : {quantity: 20, product: CHARCOAL_BARBECUE} |
void |
testPartiallySourced()
Given an order with 2 entries:
entry 1 : {quantity: 10, product: PROPANE_BARBECUE} entry 2 : {quantity: 20, product: CHARCOAL_BARBECUE} |
void |
testSourceCompleteFrom3Locations()
Given an order with 2 entries:
entry 1 : {quantity: 10, product: PROPANE_BARBECUE} entry 2 : {quantity: 20, product: CHARCOAL_BARBECUE} |
void |
testSourcingNoRestriction1Location()
Given an order with 2 entries:
entry 1 : {quantity: 10, product: PROPANE_BARBECUE} entry 2 : {quantity: 20, product: CHARCOAL_BARBECUE} |
void |
testSourcingNoRestrictionSplit2Location()
Given an order with 2 entries:
entry 1 : {quantity: 10, product: PROPANE_BARBECUE} entry 2 : {quantity: 20, product: CHARCOAL_BARBECUE} |
public void setup()
public void testSourcingNoRestriction1Location()
Result:
It should source complete from 1 location
{Warehouse: RECIFE, Availability : {[PROPANE_BARBECUE,10], [CHARCOAL_BARBECUE,20}}
Assert:
It verifies the number of SourcingResult
It verifies the PointOfServiceModel where the order entries were sourced
It checks if the source is completed.
public void testSourcingNoRestrictionSplit2Location()
Result:
It should source PROPANE_BARBECUE from 2 locations
{Warehouse: RECIFE, Availability : {[PROPANE_BARBECUE,5], [CHARCOAL_BARBECUE,20}}
{Warehouse: OLINDA, Availability : {[PROPANE_BARBECUE,5]}
Assert:
It verifies the number of SourcingResult
It verifies the PointOfServiceModel where the order entries were sourced
It checks if the source is completed.
public void testSourceCompleteFrom3Locations()
Result:
It should source PROPANE_BARBECUE from 3 locations
{Warehouse: RECIFE, Availability : {[PROPANE_BARBECUE,5], [CHARCOAL_BARBECUE,20}}
{Warehouse: OLINDA, Availability : {[PROPANE_BARBECUE,3]}
{Warehouse: PAULISTA, Availability : {[PROPANE_BARBECUE,2]}
Assert:
It verifies the number of SourcingResult
It verifies the PointOfServiceModel where the order entries were sourced
It checks if the source is completed.
public void testNothingSourced()
Result: It should not source. There is not enough stock for both entries
{Warehouse: RECIFE, Availability : {[PROPANE_BARBECUE,0]}
{Warehouse: OLINDA, Availability : {[CHARCOAL_BARBECUE,0]}
Assert:
It verifies the number of SourcingResult
It verifies the PointOfServiceModel where the order entries were sourced
It checks if the source is completed.
public void testPartiallySourced()
Result: It should not source - not enough stock for PROPANE_BARBECUE
SourcingResult
{Warehouse: RECIFE, Availability : {[PROPANE_BARBECUE,5]}
{Warehouse: OLINDA, Availability : {[CHARCOAL_BARBECUE,20]}
Assert:
It verifies the number of SourcingResult
It verifies the PointOfServiceModel where the order entries were sourced
It checks if the source is completed. It verifies the quantity sourced for each entry.
public void shouldFail_nullContext()
protected void assertEqualQuantity(SourcingContext context, long qtyExpected, ProductModel product, java.lang.String posName)
protected void assertEqualsQuantityAllocation(java.util.Set<SourcingResult> results, java.lang.String pos, int qtyExpected)
Copyright © 2018 SAP SE. All Rights Reserved.