Class OrderSourcingIntegrationTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorIntegrationTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.OrderSourcingIntegrationTest
-
- All Implemented Interfaces:
JaloSessionHolder
@IntegrationTest public class OrderSourcingIntegrationTest extends BaseAcceleratorSourcingIntegrationTest
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
atpFormulas, automatedWorkflowActionTemplates, baseStores, CAMERA_CODE, CAMERA_QTY, cancellationUtil, CODE_BOSTON, CODE_MEMORY_CARD, CODE_MONTREAL, CODE_MONTREAL_EXTERNAL, CODE_PARIS, CODE_TORONTO, commentTypes, commerceStockService, components, CONSIGNMENT_ACTION_EVENT_NAME, csAgentGroups, DECLINE_ENTRIES, declineUtil, deliveryMode, domains, emailAddresses, LEFTOVER_QTY, LENS_CODE, LENS_QTY, MEMORY_CARD_CODE, MEMORY_CARD_QTY, modelService, order, ORDER_ACTION_EVENT_NAME, orderBusinessProcessService, orders, pointsOfService, products, productService, RE_SOURCE_CHOICE, REALLOCATE_CONSIGNMENT_CHOICE, restockConfigs, returnUtil, sourcingBanService, sourcingConfigs, sourcingUtil, stockLevels, stockService, timeOut, users, warehouses, warehouseStockService, workflowActionTemplates, workflowService, workflowTemplates, workflowUtil
-
Fields inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorIntegrationTest
flexibleSearchService, springCustomContextLoader
-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description OrderSourcingIntegrationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
void
setUp()
void
shouldFailSourcing_ExternalWarehouse()
void
shouldNotConfirmTwice()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify cannot confirm order twicevoid
shouldNotSourceSourcingConfigNull()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
TheBaseStoreModel
for the Order does not haveSourcingConfigModel
.void
shouldPickLocationWithLowerScore()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Second location should be picked, even if the first one has higher score.
That's because of fitness strategy - second warehouse is able to make whole order at one time.void
shouldSourcingFail_SingleEntry()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order sourcing failedvoid
shouldSourcingSuccess_DistanceBoston()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the location where it is assignedvoid
shouldSourcingSuccess_DistanceMontreal()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the location where it is assignedvoid
shouldSourcingSuccess_ExternalWarehouse()
void
shouldSourcingSuccess_MultiEntries_MultiConsignments()
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment resultvoid
shouldSourcingSuccess_MultiEntries_MultiConsignments_SplitOrderEntries()
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment resultvoid
shouldSourcingSuccess_MultiEntry_SingleConsignment()
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment resultvoid
shouldSourcingSuccess_OMSE_640()
Given an order with 3 entries:
entry 1 : {quantity: 1, product: product1}
entry 2 : {quantity: 1, product: product2}
entry 3 : {quantity: 7, product: product3}
POS Montreal ->Montreal product1 quantity=6, product2 quantity =6, product3 quantity = 6 POS Boston ->Boston product1 quantity=6, product2 quantity =6, product3 quantity = 0 POS Toronto ->Toronto product1 quantity=0, product2 quantity =0, product3 quantity = 6 Result:
It should source complete from 2 location, 6 of product3 from Montreal, and 1 from the Torontovoid
shouldSourcingSuccess_Priority()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment resultvoid
shouldSourcingSuccess_SingleEntry()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment resultvoid
shouldSourcingSuccess_SingleEntry_PickUp()
Given an pickup order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment resultvoid
shouldTakeAllFromFirstLocationAndTheRestFromSecond()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
In this case, both locations cannot send order at one time.void
shouldTakeAllFromLocationWithHigherScore()
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Whole order will be delivered from first location because score is higher.void
updateTaskAssignmentWorkflowWithPackPickUpConsignment()
Given that a consignment is Packed the Task Assignment Workflow must also be updated.void
updateTaskAssignmentWorkflowWithPackShippingConsignment()
Given that a consignment is Packed the Task Assignment Workflow must also be updated.void
updateTaskAssignmentWorkflowWithPickupConsignment()
Given that a pickup consignment is Shipped the Task Assignment Workflow must also be updated.void
updateTaskAssignmentWorkflowWithShipConsignment()
Given that a consignment is Shipped the Task Assignment Workflow must also be updated.-
Methods inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
buildAsnWorkflow, buildConsignmentWorkflow, cleanUpData, cleanUpModel, refreshConsignmentAndEntries, resetFactors, saveAll, setup
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
cleanUp
public void cleanUp()
-
updateTaskAssignmentWorkflowWithPackShippingConsignment
public void updateTaskAssignmentWorkflowWithPackShippingConsignment() throws java.lang.InterruptedException
Given that a consignment is Packed the Task Assignment Workflow must also be updated. Result: The task assignment workflow is in the Shipping step- Throws:
java.lang.InterruptedException
-
updateTaskAssignmentWorkflowWithPackPickUpConsignment
public void updateTaskAssignmentWorkflowWithPackPickUpConsignment() throws java.lang.InterruptedException
Given that a consignment is Packed the Task Assignment Workflow must also be updated. Result: The task assignment workflow is in the Ready for Pick up step- Throws:
java.lang.InterruptedException
-
updateTaskAssignmentWorkflowWithShipConsignment
public void updateTaskAssignmentWorkflowWithShipConsignment() throws java.lang.InterruptedException
Given that a consignment is Shipped the Task Assignment Workflow must also be updated. Result: The task assignment workflow is terminated- Throws:
java.lang.InterruptedException
-
updateTaskAssignmentWorkflowWithPickupConsignment
public void updateTaskAssignmentWorkflowWithPickupConsignment() throws java.lang.InterruptedException
Given that a pickup consignment is Shipped the Task Assignment Workflow must also be updated. Result: The task assignment workflow is terminated- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_SingleEntry
public void shouldSourcingSuccess_SingleEntry() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldNotSourceSourcingConfigNull
public void shouldNotSourceSourcingConfigNull() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
TheBaseStoreModel
for the Order does not haveSourcingConfigModel
.
So the sourcing fails and order status changes to Suspended.
Later aSourcingConfigModel
is provided for theBaseStoreModel
, and as a result:
1). Sourcing is successful and consignment is created
2). The order status changes to Ready
3). The ATP is reduced by the ordered Qty- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_SingleEntry_PickUp
public void shouldSourcingSuccess_SingleEntry_PickUp() throws java.lang.InterruptedException
Given an pickup order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldSourcingFail_SingleEntry
public void shouldSourcingFail_SingleEntry() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order sourcing failed- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_Priority
public void shouldSourcingSuccess_Priority() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldPickLocationWithLowerScore
public void shouldPickLocationWithLowerScore() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Second location should be picked, even if the first one has higher score.
That's because of fitness strategy - second warehouse is able to make whole order at one time.- Throws:
java.lang.InterruptedException
-
shouldTakeAllFromFirstLocationAndTheRestFromSecond
public void shouldTakeAllFromFirstLocationAndTheRestFromSecond() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
In this case, both locations cannot send order at one time. All products will be taken from first location - because of the higher score.
To make whole order - the one product which is left will be taken from second location.- Throws:
java.lang.InterruptedException
-
shouldTakeAllFromLocationWithHigherScore
public void shouldTakeAllFromLocationWithHigherScore() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Whole order will be delivered from first location because score is higher.- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_DistanceMontreal
public void shouldSourcingSuccess_DistanceMontreal() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the location where it is assigned- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_DistanceBoston
public void shouldSourcingSuccess_DistanceBoston() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify the location where it is assigned- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_MultiEntry_SingleConsignment
public void shouldSourcingSuccess_MultiEntry_SingleConsignment() throws java.lang.InterruptedException
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_MultiEntries_MultiConsignments
public void shouldSourcingSuccess_MultiEntries_MultiConsignments() throws java.lang.InterruptedException
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_MultiEntries_MultiConsignments_SplitOrderEntries
public void shouldSourcingSuccess_MultiEntries_MultiConsignments_SplitOrderEntries() throws java.lang.InterruptedException
Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Verify the order status and consignment result- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_OMSE_640
public void shouldSourcingSuccess_OMSE_640() throws java.lang.InterruptedException
Given an order with 3 entries:
entry 1 : {quantity: 1, product: product1}
entry 2 : {quantity: 1, product: product2}
entry 3 : {quantity: 7, product: product3}
POS Montreal ->Montreal product1 quantity=6, product2 quantity =6, product3 quantity = 6 POS Boston ->Boston product1 quantity=6, product2 quantity =6, product3 quantity = 0 POS Toronto ->Toronto product1 quantity=0, product2 quantity =0, product3 quantity = 6 Result:
It should source complete from 2 location, 6 of product3 from Montreal, and 1 from the Toronto- Throws:
java.lang.InterruptedException
-
shouldNotConfirmTwice
public void shouldNotConfirmTwice() throws java.lang.InterruptedException
Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Verify cannot confirm order twice- Throws:
java.lang.InterruptedException
-
shouldSourcingSuccess_ExternalWarehouse
public void shouldSourcingSuccess_ExternalWarehouse() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
shouldFailSourcing_ExternalWarehouse
public void shouldFailSourcing_ExternalWarehouse() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-